<AWT Dev> RFR: 6422025: ThemeReader.cpp can be updated for VC7

Alexey Ivanov aivanov at openjdk.java.net
Fri Nov 6 22:45:58 UTC 2020

On Fri, 6 Nov 2020 22:09:52 GMT, Sergey Bylokhov <serb at openjdk.org> 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

More information about the awt-dev mailing list