From d7443f64afa884e694397a9dd6870accaaae2f30 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 12 Aug 2023 16:25:30 +0300 Subject: [PATCH] [WIN32_REGISTRY] Add win32_registry static library To be used by NT6 apis in kernel32 This is not great. It works, but it puts stuff into the lib that shouldn't be in there. We need it, because the includes need the generated files. Maybe a dependency could solve that. --- dll/win32/advapi32/CMakeLists.txt | 13 ++++++++++--- dll/win32/kernel32/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dll/win32/advapi32/CMakeLists.txt b/dll/win32/advapi32/CMakeLists.txt index d1833586bb010..3dd877227537f 100644 --- a/dll/win32/advapi32/CMakeLists.txt +++ b/dll/win32/advapi32/CMakeLists.txt @@ -25,8 +25,6 @@ list(APPEND SOURCE misc/shutdown.c misc/sysfunc.c misc/unicode.c - reg/hkcr.c - reg/reg.c sec/ac.c sec/audit.c sec/lsa.c @@ -54,6 +52,15 @@ list(APPEND PCH_SKIP_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/svcctl_c.c ${CMAKE_CURRENT_BINARY_DIR}/winreg_c.c) +# This static library is for kernelbase and vista APIs in kernel32 +add_library(win32_registry + ${PCH_SKIP_SOURCE} + reg/hkcr.c + reg/reg.c +) +target_link_libraries(win32_registry ${PSEH_LIB}) +target_compile_definitions(win32_registry PRIVATE _KERNEL32_ UNICODE _UNICODE) + add_library(advapi32 MODULE ${SOURCE} ${PCH_SKIP_SOURCE} @@ -61,7 +68,7 @@ add_library(advapi32 MODULE ${CMAKE_CURRENT_BINARY_DIR}/advapi32.def) set_module_type(advapi32 win32dll UNICODE ENTRYPOINT DllMain 12) -target_link_libraries(advapi32 cryptlib wine ${PSEH_LIB}) +target_link_libraries(advapi32 win32_registry cryptlib wine ${PSEH_LIB}) if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600) target_link_libraries(advapi32 etwtrace) endif() diff --git a/dll/win32/kernel32/CMakeLists.txt b/dll/win32/kernel32/CMakeLists.txt index 8fb782283ccbb..217ec8fe80837 100644 --- a/dll/win32/kernel32/CMakeLists.txt +++ b/dll/win32/kernel32/CMakeLists.txt @@ -130,7 +130,7 @@ set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12) set_subsystem(kernel32 console) ################# END HACK ################# -target_link_libraries(kernel32 kernelbase_static kernel32_vista_static kernel32_shared wine chkstk ${PSEH_LIB}) +target_link_libraries(kernel32 win32_registry kernelbase_static kernel32_vista_static kernel32_shared wine chkstk ${PSEH_LIB}) add_importlibs(kernel32 ntdll) add_pch(kernel32 k32.h SOURCE) add_dependencies(kernel32 psdk errcodes asm)