@@ -319,21 +319,18 @@ static void install_delayed_hooks(const std::filesystem::path &loaded_path, bool
319319}
320320
321321const auto check_delayed_hook_path = [](const std::filesystem::path &path) -> HMODULE {
322- // Skip export module if it was loaded somehow before/outside of 'ensure_export_module_loaded' below
323- if (path == s_export_hook_path)
324- return nullptr ;
325-
326322// Pin the module so it cannot be unloaded by the application and cause problems when ReShade tries to call into it afterwards
327323HMODULE delayed_handle =nullptr ;
328- if (!GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_PIN, path.c_str (), &delayed_handle))
324+ if (!GetModuleHandleExW (GET_MODULE_HANDLE_EX_FLAG_PIN, path.c_str (), &delayed_handle) || delayed_handle == g_module_handle )
329325return nullptr ;
330326
331327return delayed_handle;
332328};
333329const auto install_delayed_hook_path = [&loaded_path](const std::filesystem::path &path, HMODULE delayed_handle) {
334330reshade::log::message (reshade::log::level::info," Installing delayed hooks for '%s' (Just loaded via LoadLibrary('%s')) ..." , path.u8string ().c_str (), loaded_path.u8string ().c_str ());
335331
336- install_internal (delayed_handle, g_module_handle, hook_method::function_hook) &&reshade::hook::apply_queued_actions ();
332+ install_internal (delayed_handle, g_module_handle, hook_method::function_hook);
333+ reshade::hook::apply_queued_actions ();
337334};
338335
339336if (const auto it =std::find_if (s_delayed_hook_paths.begin (), s_delayed_hook_paths.end (),
@@ -578,7 +575,6 @@ void reshade::hooks::register_module(const std::filesystem::path &target_path)
578575log::message (log::level::info," > Libraries loaded." );
579576
580577install_internal (handle, g_module_handle, hook_method::function_hook);
581-
582578hook::apply_queued_actions ();
583579}
584580}