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

David Holmes dholmes at openjdk.org
Mon Sep 23 09:59:36 UTC 2024


On Mon, 23 Sep 2024 08:46:13 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:
> 
>   Update os_windows.cpp

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

> 4091: bool   os::win32::_job_object_processor_group_warning_displayed = false;
> 4092: 
> 4093: void GetWindowsInstallationType(char* buffer, int bufferSize) {

Nit: we don't use this naming style in hotspot. This should be either `getWindowsInstallationType` or `get_windows_installation_type`. Thanks

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

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

Is this a protected key or should we generally expect reading it to always succeed?

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

> 4117: }
> 4118: 
> 4119: bool IsNanoServer() {

Again naming style.

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

> 4121:   char installationType[BUFFER_SIZE];
> 4122:   GetWindowsInstallationType(installationType, BUFFER_SIZE);
> 4123:   return (lstrcmpA(installationType, "Nano Server") == 0);

Just curious do we really need `lstrcmpA` here rather than plain old `strcmp`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1771089899
PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1771091392
PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1771095326
PR Review Comment: https://git.openjdk.org/jdk/pull/21070#discussion_r1771098410


More information about the hotspot-runtime-dev mailing list