<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class=""><a href="https://bugs.openjdk.java.net/browse/JDK-8218418" class="">https://bugs.openjdk.java.net/browse/JDK-8218418</a></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">The proposed change below ran without error through the jdk_core tests on Windows. Presumably it is covered sufficiently by </span>test/jdk/java/nio/file/Files/Links.java so the issue could be labelled noreg-other.</div></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class="">Thanks,</div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class=""><br class=""></div><div style="margin: 0px; font-stretch: normal; line-height: normal; background-color: rgba(255, 255, 255, 0.811765);" class="">Brian</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">--- a/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+++ b/src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">@@ -1063,8 +1063,14 @@</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">     LPCWSTR link = jlong_to_ptr(linkAddress);</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">     LPCWSTR target = jlong_to_ptr(targetAddress);</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765); min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">-    /* On Windows 64-bit this appears to succeed even when there is insufficient privileges */</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">-    if (CreateSymbolicLinkW(link, target, (DWORD)flags) == 0)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    // Allow creation of symbolic links when the process is not elevated.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    // Developer Mode must be enabled for this option to function, otherwise</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    // it will be ignored.</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    DWORD dwFlags = (DWORD)flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    // On Windows 64-bit this appears to succeed even when there are</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    // insufficient privileges</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">+    if (CreateSymbolicLinkW(link, target, dwFlags) == 0)</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">         throwWindowsException(env, GetLastError());</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgba(255, 255, 255, 0.811765);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div></span></div></div></div></div></body></html>