MCPcopy Create free account
hub / github.com/crosire/reshade / install

Method install

source/hook_manager.cpp:441–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439#endif
440
441bool reshade::hooks::install(const char *name, hook::address target, hook::address replacement, bool queue_enable)
442{
443 if (target == nullptr)
444 return false;
445
446 assert(replacement != nullptr);
447
448 named_hook hook = find_internal(nullptr, replacement);
449 // If the hook was already installed, make sure it was installed for the same target function
450 if (hook.installed())
451 return target == hook.target;
452
453 // Otherwise, set up the new hook and install it
454 hook.target = target;
455 hook.replacement = replacement;
456
457 return install_internal(name, hook, hook_method::function_hook) &&
458 (queue_enable || hook::apply_queued_actions()); // Can optionally only queue up the hooks instead of installing them right away
459}
460bool reshade::hooks::install(const char *name, hook::address vtable[], size_t vtable_index, hook::address replacement)
461{
462 assert(vtable != nullptr && replacement != nullptr);

Callers 1

install_internalFunction · 0.45

Calls 3

find_internalFunction · 0.85
install_internalFunction · 0.85
installedMethod · 0.80

Tested by

no test coverage detected