| 632 | } |
| 633 | |
| 634 | reshade::hook::address reshade::hooks::call(hook::address replacement, hook::address target) |
| 635 | { |
| 636 | for (int attempt = 0; attempt < 2; ++attempt) |
| 637 | { |
| 638 | const hook hook = find_internal(target, replacement); |
| 639 | if (hook.valid()) |
| 640 | return hook.call(); |
| 641 | else if (attempt == 0) |
| 642 | // If the hook does not exist yet, delay-load export hooks and try again |
| 643 | ensure_export_module_loaded(); |
| 644 | } |
| 645 | |
| 646 | log::message(log::level::error, "Unable to resolve hook for %p!", replacement); |
| 647 | |
| 648 | return nullptr; |
| 649 | } |
no test coverage detected