On Fri, 6 Nov 2020 22:09:52 GMT, Sergey Bylokhov <[email protected]> wrote:
>> src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp line 126:
>>
>>> 124: DTRACE_PRINTLN("Loaded UxTheme.dll\n");
>>> 125: OpenThemeDataFunc =
>>> (PFNOPENTHEMEDATA)GetProcAddress(hModThemes,
>>> 126:
>>> "OpenThemeData");
>>
>> Can't we use the functions directly? I mean we can link to `UxTheme.lib` and
>> load the `UxTheme.dll` automatically.
>> Dynamic loading was necessary for Windows versions before Windows XP where
>> `UxTheme.dll` doesn't exist.
>
> That's was my comment in the description about:
>
>> It is time to use UxTheme.h directly, note I did not change how we load
>> this library(JDK_LoadSystemLibrary(), as suggested in the comments of the
>> bug it is not necessary that the application will use the win L&F and it is
>> not necessary to link it directly,
>
> also, the native win L&F is an optional thing.
Thank you for the clarification. I must have missed this note. Yes, I later
realised that it could be the reason why you didn't update how the DLL is
loaded.
Delay-load is another option, on the other hand there's already the code to
load the library and get the function pointers.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1090