From af370088fc178996a46ee508aaa1a2c46318bbf2 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 26 Dec 2025 23:12:11 +0000 Subject: Move to static trampolines and type-safe hooks For some reason the DLL got a tiny little bit bigger again but that's fine. This will make orig_ calls more efficient in the inline case, and also make it harder to screw up and hook the wrong thing by mistake. Self-explanatory-ish, apart from the fact it's a fairly large API change of course. And it relies on some more bonkers assembler directive hackery. But it works! The only complaint one might have is that the featsetup functions no longer take an explicit string which occasionally yields slightly less perfect error messages, but I've decided this isn't really a problem and makes the API nicer to use. It's a tradeoff, innit. --- DevDocs/code-style.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'DevDocs/code-style.txt') diff --git a/DevDocs/code-style.txt b/DevDocs/code-style.txt index cdbc666..11d9405 100644 --- a/DevDocs/code-style.txt +++ b/DevDocs/code-style.txt @@ -785,8 +785,9 @@ Some other common prefixes and suffixes are just good for making the whole thing feel coherent to a human reader even if nothing really requires them: • *_func for function pointer typedefs. -• orig_* for a function pointer used to call an original function from a hook. -• hook_* for the hook function itself, which intercepts calls to the original. +• orig_* for a pointer (or static trampoline) to a function that has been hooked + in some manner. +• hookdest_* for the intercepting function called in place of a hooked function. • find_* for a function within a feature which attempts to find some variable or function buried within the engine, usually by chasing pointers through machine instructions or internal engine data structures or something. -- cgit v1.2.3-54-g00ecf