RFR: 8340383: VM issues warning failure to find kernel32.dll on Windows nanoserver [v2]

Martijn Verburg karianna at openjdk.org
Fri Sep 20 21:21:36 UTC 2024


On Fri, 20 Sep 2024 12:12:07 GMT, George Adams <gdams at openjdk.org> wrote:

>> On Windows Nanoserver the `kernel32.dll` is not within the System32 directory itself but within the "forwarders" sub-folder.
>> 
>> See a similar bug reported in dotnet a while back: https://github.com/dotnet/sdk/issues/6056
>
> George Adams has updated the pull request incrementally with one additional commit since the last revision:
> 
>   refactor to extract nanoserver detection

src/hotspot/os/windows/os_windows.cpp line 4102:

> 4100: 
> 4101:   // Open the registry key
> 4102:   if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, subKey, 0, KEY_READ, &hKey) != ERROR_SUCCESS) {

Do we want to log when we can't read this value?

src/hotspot/os/windows/os_windows.cpp line 4118:

> 4116: bool IsNanoServer() {
> 4117:   std::string installationType = GetWindowsInstallationType();
> 4118:   return installationType == "Nano Server";

Not sure how OpenJDK source code typically deals with magic strings, but should this get extracted to a const?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1769266733
PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1769267233


More information about the hotspot-runtime-dev mailing list