ruby-changes:68111
From: Nobuyoshi <ko1@a...>
Date: Fri, 24 Sep 2021 12:37:49 +0900 (JST)
Subject: [ruby-changes:68111] 845c017e08 (master): Reminders of the Windows versions each API is available [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=845c017e08 From 845c017e0847ec3eedf50900f922a63d3c8c1f71 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 24 Sep 2021 12:31:20 +0900 Subject: Reminders of the Windows versions each API is available [ci skip] --- win32/win32.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/win32/win32.c b/win32/win32.c index 241c9ac..23a69fd 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2004,6 +2004,7 @@ get_final_path_fail(HANDLE f, WCHAR *buf, DWORD len, DWORD flag) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L2004 static DWORD WINAPI 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_proc_address("kernel32", "GetFinalPathNameByHandleW", NULL); if (!func) func = get_final_path_fail; @@ -5209,6 +5210,7 @@ w32_symlink(UINT cp, const char *src, const char *link) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5210 static DWORD create_flag = SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE; if (create_symbolic_link == (create_symbolic_link_func)-1) { + /* Since Windows Vista and Windows Server 2008 */ create_symbolic_link = (create_symbolic_link_func) get_proc_address("kernel32", "CreateSymbolicLinkW", NULL); } @@ -5540,6 +5542,7 @@ get_ino(HANDLE h, FILE_ID_INFO *id) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5542 static gfibhe_t 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); if (pGetFileInformationByHandleEx) { @@ -7753,6 +7756,7 @@ fchmod(int fd, int mode) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L7756 return -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) get_proc_address("kernel32", "SetFileInformationByHandle", NULL); } @@ -8159,6 +8163,7 @@ rb_w32_set_thread_description(HANDLE th, const WCHAR *name) https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L8163 static set_thread_description_func 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) get_proc_address("kernel32", "SetThreadDescription", NULL); } -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/