Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native DLLs: only load imported DLLs from System32 #112359

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ if (MSVC)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:$<TARGET_PROPERTY:CLR_EH_OPTION>>)
add_link_options($<$<BOOL:$<TARGET_PROPERTY:CLR_CONTROL_FLOW_GUARD>>:/guard:cf>)

# Load all imported DLLs from the System32 directory.
add_linker_flag(/DEPENDENTLOADFLAG:0x800)

# Linker flags
#
set (WINDOWS_SUBSYSTEM_VERSION 6.01)
Expand Down
4 changes: 4 additions & 0 deletions eng/native/ijw/IJW.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ if (CLR_CMAKE_HOST_WIN32)
remove_ijw_incompatible_options("${dirCompileOptions}" dirCompileOptions)
set_directory_properties(PROPERTIES COMPILE_OPTIONS "${dirCompileOptions}")

# IJW tests needs to load DLLs from somewhere other than System32
string(REPLACE "/DEPENDENTLOADFLAG:0x800" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
string(REPLACE "/DEPENDENTLOADFLAG:0x800" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")

set(CLR_SDK_REF_PACK_OUTPUT "")
set(CLR_SDK_REF_PACK_DISCOVERY_ERROR "")
set(CLR_SDK_REF_PACK_DISCOVERY_RESULT 0)
Expand Down
Loading