1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Reminders of the Windows versions each API is available [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-09-24 12:31:20 +09:00
parent 0eb679f70c
commit 845c017e08
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -2004,6 +2004,7 @@ get_final_path_fail(HANDLE f, WCHAR *buf, DWORD len, DWORD flag)
static DWORD WINAPI static DWORD WINAPI
get_final_path_unknown(HANDLE f, WCHAR *buf, DWORD len, DWORD flag) get_final_path_unknown(HANDLE f, WCHAR *buf, DWORD len, DWORD flag)
{ {
/* Since Windows Vista and Windows Server 2008 */
get_final_path_func func = (get_final_path_func) get_final_path_func func = (get_final_path_func)
get_proc_address("kernel32", "GetFinalPathNameByHandleW", NULL); get_proc_address("kernel32", "GetFinalPathNameByHandleW", NULL);
if (!func) func = get_final_path_fail; if (!func) func = get_final_path_fail;
@ -5209,6 +5210,7 @@ w32_symlink(UINT cp, const char *src, const char *link)
static DWORD create_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; static DWORD create_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
if (create_symbolic_link == (create_symbolic_link_func)-1) { if (create_symbolic_link == (create_symbolic_link_func)-1) {
/* Since Windows Vista and Windows Server 2008 */
create_symbolic_link = (create_symbolic_link_func) create_symbolic_link = (create_symbolic_link_func)
get_proc_address("kernel32", "CreateSymbolicLinkW", NULL); get_proc_address("kernel32", "CreateSymbolicLinkW", NULL);
} }
@ -5540,6 +5542,7 @@ get_ino(HANDLE h, FILE_ID_INFO *id)
static gfibhe_t pGetFileInformationByHandleEx = (gfibhe_t)-1; static gfibhe_t pGetFileInformationByHandleEx = (gfibhe_t)-1;
if (pGetFileInformationByHandleEx == (gfibhe_t)-1) if (pGetFileInformationByHandleEx == (gfibhe_t)-1)
/* Since Windows Vista and Windows Server 2008 */
pGetFileInformationByHandleEx = (gfibhe_t)get_proc_address("kernel32", "GetFileInformationByHandleEx", NULL); pGetFileInformationByHandleEx = (gfibhe_t)get_proc_address("kernel32", "GetFileInformationByHandleEx", NULL);
if (pGetFileInformationByHandleEx) { if (pGetFileInformationByHandleEx) {
@ -7753,6 +7756,7 @@ fchmod(int fd, int mode)
return -1; return -1;
} }
if (set_file_info == (set_file_information_by_handle_func)-1) { if (set_file_info == (set_file_information_by_handle_func)-1) {
/* Since Windows Vista and Windows Server 2008 */
set_file_info = (set_file_information_by_handle_func) set_file_info = (set_file_information_by_handle_func)
get_proc_address("kernel32", "SetFileInformationByHandle", NULL); get_proc_address("kernel32", "SetFileInformationByHandle", NULL);
} }
@ -8159,6 +8163,7 @@ rb_w32_set_thread_description(HANDLE th, const WCHAR *name)
static set_thread_description_func set_thread_description = static set_thread_description_func set_thread_description =
(set_thread_description_func)-1; (set_thread_description_func)-1;
if (set_thread_description == (set_thread_description_func)-1) { if (set_thread_description == (set_thread_description_func)-1) {
/* Since Windows 10, version 1607 and Windows Server 2016 */
set_thread_description = (set_thread_description_func) set_thread_description = (set_thread_description_func)
get_proc_address("kernel32", "SetThreadDescription", NULL); get_proc_address("kernel32", "SetThreadDescription", NULL);
} }