diff options
| author | 2025-12-26 23:12:11 +0000 | |
|---|---|---|
| committer | 2026-02-16 19:11:24 +0000 | |
| commit | af370088fc178996a46ee508aaa1a2c46318bbf2 (patch) | |
| tree | cf1f6c01ad7c101d3fd4abb44835d9deb600e30d /DevDocs | |
| parent | 40f9d989df2c1ff2f567656ccbdbfc0d97e34a77 (diff) | |
| download | sst-af370088fc178996a46ee508aaa1a2c46318bbf2.tar.gz sst-af370088fc178996a46ee508aaa1a2c46318bbf2.zip | |
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.
Diffstat (limited to 'DevDocs')
| -rw-r--r-- | DevDocs/code-style.txt | 5 |
1 files changed, 3 insertions, 2 deletions
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. |
