On Mon, 20 Jan 2025 16:49:33 GMT, Alexey Ivanov <[email protected]> wrote:
>> Magnus Ihse Bursie has updated the pull request with a new target base due
>> to a merge or a rebase. The pull request now contains five commits:
>>
>> - Merge branch 'master' into dll-main-in-libawt
>> - Simplify patch
>> - Merge branch 'master' into dll-main-in-libawt
>> - Merge branch 'master' into dll-main-in-libawt
>> - 8346388: Cannot use DllMain in libawt for static builds
>
> src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp line 108:
>
>> 106: * of a dynamic library build, or the .EXE in case of a static build.
>> 107: */
>> 108: HMODULE GetAwtModuleHandle() {
>
> Should it be `static`? The function `GetAwtModuleHandle` isn't used outside
> of this translation unit and can be marked `static` to explicitly hide from
> other translation units unless it stops working.
Actually, this function needs to be **not** static for it to work -- it uses
it's own address to look up the handle that contains it -- which will be
awt.dll when running a normal, dynamic build, and the entire java.exe when
running a static build.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22790#discussion_r1922859162