summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2024-08-28 20:12:09 +0300
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2024-08-28 20:12:09 +0300
commitd528f28275b4fb8753e0344a331c89f9c81c5a47 (patch)
tree8e28e043a5c461579eb7d05f9badedda8251fab9
parentf648de1a83cf006dbfdaa075219ad4348628e58f (diff)
downloadredot-engine-d528f28275b4fb8753e0344a331c89f9c81c5a47.tar.gz
[Windows] Fix OS.open_dynamic_library
-rw-r--r--modules/mono/editor/hostfxr_resolver.cpp2
-rw-r--r--platform/windows/os_windows.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/mono/editor/hostfxr_resolver.cpp b/modules/mono/editor/hostfxr_resolver.cpp
index 7fa482969e..e93c9a5faf 100644
--- a/modules/mono/editor/hostfxr_resolver.cpp
+++ b/modules/mono/editor/hostfxr_resolver.cpp
@@ -260,7 +260,7 @@ bool get_dotnet_self_registered_dir(String &r_dotnet_root) {
return false;
}
- r_dotnet_root = String::utf16((const char16_t *)buffer.ptr());
+ r_dotnet_root = String::utf16((const char16_t *)buffer.ptr()).replace("\\", "/");
RegCloseKey(hkey);
return true;
#else
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index bc42b234be..47836788e1 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -430,13 +430,13 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha
bool has_dll_directory_api = ((add_dll_directory != nullptr) && (remove_dll_directory != nullptr));
DLL_DIRECTORY_COOKIE cookie = nullptr;
- String dll_dir = ProjectSettings::get_singleton()->globalize_path(load_path.get_base_dir());
- String wpath = fix_path(dll_dir);
+ String dll_path = fix_path(load_path);
+ String dll_dir = fix_path(ProjectSettings::get_singleton()->globalize_path(load_path.get_base_dir()));
if (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) {
- cookie = add_dll_directory((LPCWSTR)(wpath.get_base_dir().utf16().get_data()));
+ cookie = add_dll_directory((LPCWSTR)(dll_dir.utf16().get_data()));
}
- p_library_handle = (void *)LoadLibraryExW((LPCWSTR)(wpath.utf16().get_data()), nullptr, (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0);
+ p_library_handle = (void *)LoadLibraryExW((LPCWSTR)(dll_path.utf16().get_data()), nullptr, (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) ? LOAD_LIBRARY_SEARCH_DEFAULT_DIRS : 0);
if (!p_library_handle) {
if (p_data != nullptr && p_data->generate_temp_files) {
DirAccess::remove_absolute(load_path);
@@ -447,7 +447,7 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha
HashSet<String> checked_libs;
HashSet<String> missing_libs;
- debug_dynamic_library_check_dependencies(wpath, checked_libs, missing_libs);
+ debug_dynamic_library_check_dependencies(dll_path, checked_libs, missing_libs);
if (!missing_libs.is_empty()) {
String missing;
for (const String &E : missing_libs) {