Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a3356e

Browse files
committed
Fix hooking when application uses NVIDIA Streamline again
This reverts commitb1d29f1
1 parentf3f82ea commit0a3356e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

‎source/hook_manager.cpp‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,21 +319,18 @@ static void install_delayed_hooks(const std::filesystem::path &loaded_path, bool
319319
}
320320

321321
constauto 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-
returnnullptr;
325-
326322
// Pin the module so it cannot be unloaded by the application and cause problems when ReShade tries to call into it afterwards
327323
HMODULE 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)
329325
returnnullptr;
330326

331327
return delayed_handle;
332328
};
333329
constauto install_delayed_hook_path = [&loaded_path](const std::filesystem::path &path, HMODULE delayed_handle) {
334330
reshade::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

339336
if (constauto 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)
578575
log::message(log::level::info,"> Libraries loaded.");
579576

580577
install_internal(handle, g_module_handle, hook_method::function_hook);
581-
582578
hook::apply_queued_actions();
583579
}
584580
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp