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

Add delay load hook for singlefilehost and enable delay load of version.dll #87495

Merged
merged 1 commit into from
Jun 14, 2023
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
2 changes: 1 addition & 1 deletion src/coreclr/dlls/mscoree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(CLR_SOURCES

if(CLR_CMAKE_TARGET_WIN32)
list(APPEND CLR_SOURCES
delayloadhook.cpp
${CLR_SRC_NATIVE_DIR}/libs/Common/delayloadhook_windows.cpp
Native.rc
)

Expand Down
7 changes: 6 additions & 1 deletion src/native/corehost/apphost/static/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ endif()
if(CLR_CMAKE_TARGET_WIN32)
add_definitions(-DUNICODE)
list(APPEND SOURCES
../apphost.windows.cpp)
../apphost.windows.cpp
${CLR_SRC_NATIVE_DIR}/libs/Common/delayloadhook_windows.cpp
)

list(APPEND HEADERS
../apphost.windows.h)
Expand Down Expand Up @@ -106,6 +108,9 @@ if(CLR_CMAKE_TARGET_WIN32)

# Delay load libraries required for WinRT as that is not supported on all platforms
add_linker_flag("/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll")

# Delay load version.dll so that we can specify how to search when loading it as it is not part of Windows' known DLLs
add_linker_flag("/DELAYLOAD:version.dll")
endif()

if(CLR_CMAKE_TARGET_WIN32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
// File: delayloadhook.cpp
//

#include "stdafx.h"

#include <windows.h>
#include <delayimp.h>

FARPROC WINAPI secureDelayHook(unsigned dliNotify, PDelayLoadInfo pdli)
Expand Down