From a723ff56005cd178d813712b5139e2d89696b2f2 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 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dll/win32/advapi32/CMakeLists.txt b/dll/win32/advapi32/CMakeLists.txt index d1833586bb0..3dd87722753 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()