summaryrefslogtreecommitdiffstats
path: root/platform
diff options
context:
space:
mode:
authorDavid Snopek <dsnopek@gmail.com>2024-08-27 17:38:30 -0500
committerRémi Verschelde <rverschelde@gmail.com>2024-09-16 17:24:05 +0200
commit9946eba398408505268bc5b0a5aeaae91d185139 (patch)
tree3ddcb35a27f692f4e2ac758872e285c074ae972e /platform
parent30bba8745c4b673b56e27c898c194fc2fd582eaa (diff)
downloadredot-engine-9946eba398408505268bc5b0a5aeaae91d185139.tar.gz
Windows: Call `AddDllDirectory()` with an absolute path
(cherry picked from commit e8bd385f534cf02696100d90a2c4ed636353cddc)
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/os_windows.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 40b265785f..e41e6ecc96 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -420,7 +420,8 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha
DLL_DIRECTORY_COOKIE cookie = nullptr;
if (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) {
- cookie = add_dll_directory((LPCWSTR)(load_path.get_base_dir().utf16().get_data()));
+ String dll_dir = ProjectSettings::get_singleton()->globalize_path(load_path.get_base_dir());
+ cookie = add_dll_directory((LPCWSTR)(dll_dir.utf16().get_data()));
}
p_library_handle = (void *)LoadLibraryExW((LPCWSTR)(load_path.utf16().get_data()), nullptr, (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0);