@@ -430,13 +430,13 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha
430430 bool has_dll_directory_api = ((add_dll_directory != nullptr ) && (remove_dll_directory != nullptr ));
431431 DLL_DIRECTORY_COOKIE cookie = nullptr ;
432432
433- String dll_dir = ProjectSettings::get_singleton ()-> globalize_path ( load_path. get_base_dir () );
434- String wpath = fix_path (dll_dir );
433+ String dll_path = fix_path ( load_path);
434+ String dll_dir = fix_path (ProjectSettings::get_singleton ()-> globalize_path (load_path. get_base_dir ()) );
435435 if (p_data != nullptr && p_data->also_set_library_path && has_dll_directory_api) {
436- cookie = add_dll_directory ((LPCWSTR)(wpath. get_base_dir () .utf16 ().get_data ()));
436+ cookie = add_dll_directory ((LPCWSTR)(dll_dir .utf16 ().get_data ()));
437437 }
438438
439- 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 );
439+ 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 );
440440 if (!p_library_handle) {
441441 if (p_data != nullptr && p_data->generate_temp_files ) {
442442 DirAccess::remove_absolute (load_path);
@@ -447,7 +447,7 @@ Error OS_Windows::open_dynamic_library(const String &p_path, void *&p_library_ha
447447
448448 HashSet<String> checked_libs;
449449 HashSet<String> missing_libs;
450- debug_dynamic_library_check_dependencies (wpath , checked_libs, missing_libs);
450+ debug_dynamic_library_check_dependencies (dll_path , checked_libs, missing_libs);
451451 if (!missing_libs.is_empty ()) {
452452 String missing;
453453 for (const String &E : missing_libs) {
0 commit comments