On Mon, 18 Sep 2023 14:44:13 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
> Please review this patch that makes java.dll load shell32.dll earlier. > Delay-loading requires some additional code (delayimp.lib), and offers no > benefits since we always load shell32 during JVM startup. > > Other than removing the delayload clause, the patch also cleans up the > `getHomeFromShell32` method: > - the WinXP code path is removed. The documentation states that [the older > function just calls the new one with translated > parameters](https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha). > - `CoTaskMemFree` is now called if `SHGetKnownFolderPath` fails. This is > suggested by the documentation, but probably never needed in practice. > > This change shouldn't have any observable effect on behavior on any of the > supported operating systems. It reduced the size of java.dll by 2KB on my > machine. > No new tests. Existing tier1-2 tests continue to pass. Well yes, if `SHGetKnownFolderPath` were available in Win2k, delayload would probably have been removed in 3b0f760747ae66cdd343a5e1d623af65e089b442. Oracle docs state that JDK17 only supports Win8 and newer: https://www.oracle.com/java/technologies/javase/products-doc-jdk17certconfig.html We recently integrated a change that requires Vista or newer: [JDK-8302659](https://bugs.openjdk.org/browse/JDK-8302659) During compilation we enable APIs from Win8: https://github.com/openjdk/jdk/blob/2e2d49c76d7bb43a431b5c4f2552beef8798258b/make/autoconf/flags-cflags.m4#L494 based on the above, I believe we can ignore WinXP compatibility here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15789#issuecomment-1723814098