From 07c413637ed6226f4dfaaa1ea7dcdcdcdb443815 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 15 May 2026 16:04:56 +0300 Subject: [PATCH] [KERNEL32_VISTA] Don't delay-import from ntdll_vista kernel32 functions can be called during process-attach. The same must be true for kernel32_vista. Wine's msvcrt calls GetUserDefaultLocaleName in kernel32_vista during process attach, which calls RtlLcidToLocaleName in ntdll_vista. If that function is delay-loaded (which is probably not allowed anyway during process-attach), the dll will not be initialized, the default user locale is 0 and RtlLcidToLocaleName fails. Wine code doesn't check for failure and instead continues copying an uninitialized string buffer into the heap, causing heap corruption. After removing the (redundant) add_delay_importlibs entry, this doesn't happen any longer. This reverts commit 4f5478d. There is no effect on memory usage, because we load ntdll_vista anyway. See CORE-13361. --- dll/win32/kernel32/kernel32_vista/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/dll/win32/kernel32/kernel32_vista/CMakeLists.txt b/dll/win32/kernel32/kernel32_vista/CMakeLists.txt index a53bd7a324e..1e24b0b5134 100644 --- a/dll/win32/kernel32/kernel32_vista/CMakeLists.txt +++ b/dll/win32/kernel32/kernel32_vista/CMakeLists.txt @@ -42,6 +42,5 @@ add_library(kernel32_vista MODULE set_module_type(kernel32_vista win32dll ENTRYPOINT DllMain 12) target_link_libraries(kernel32_vista kernel32_vista_static kernel32_shared) add_importlibs(kernel32_vista kernel32 ntdll_vista ntdll) -add_delay_importlibs(kernel32_vista ntdll_vista) add_dependencies(kernel32_vista psdk) add_cd_file(TARGET kernel32_vista DESTINATION reactos/system32 FOR all)