Skip to content

Better support for Handling Limit Adjusters and mods loading files from DllMain#137

Open
CookiePLMonster wants to merge 2 commits intothelink2012:masterfrom
CookiePLMonster:handling-limit-adjuster
Open

Better support for Handling Limit Adjusters and mods loading files from DllMain#137
CookiePLMonster wants to merge 2 commits intothelink2012:masterfrom
CookiePLMonster:handling-limit-adjuster

Conversation

@CookiePLMonster
Copy link
Copy Markdown
Contributor

@CookiePLMonster CookiePLMonster commented May 6, 2026

  1. Un-hardcodes the CHandlingData array for the handling hot-reload function, now it reads the code pointer every time. This way it'll work best it can with OLA and other mods breaking the handling limits.
  2. As suggested by @nta, it is possible to hook the ASI's IAT before it calls DllMain by leveraging DLL Load Notifications. They don't have publicly exposed API functions, but as evidenced, they're somewhat documented - and we're using them as conservatively as possible, bailing out on any error or a missing function. If Microsoft ever "delivers" and removes those functions, we simply fall back to the current behaviour of hooking the IAT directly after LoadLibrary.

Fixes #136. Many mods in the "incompatible" list are probably now compatible, as many of them were excluded solely because they are loading files in DllMain - but I have not verified them.

Implements a III Aircraft TODO, but also improves compatibility
with the Handling Limit Adjuster.
@CookiePLMonster CookiePLMonster force-pushed the handling-limit-adjuster branch from f50c2e3 to ac68e41 Compare May 8, 2026 08:18
@CookiePLMonster
Copy link
Copy Markdown
Contributor Author

III.VehicleAudioLoader.asi joined the naughty list for the same reason as the handling limit adjuster.

@CookiePLMonster CookiePLMonster marked this pull request as draft May 8, 2026 19:38
This lets modloader intercept IAT before ASIs call DllMain,
so previously incompatible mods may now be compatible.
@CookiePLMonster CookiePLMonster force-pushed the handling-limit-adjuster branch from ac68e41 to c8ac5b2 Compare May 8, 2026 20:15
@CookiePLMonster CookiePLMonster marked this pull request as ready for review May 8, 2026 20:18
@CookiePLMonster
Copy link
Copy Markdown
Contributor Author

As suggested by @nta, it is possible to hook the ASI's IAT before it calls DllMain by leveraging DLL Load Notifications. They don't have publicly exposed API functions, but as evidenced, they're somewhat documented - and we're using them as conservatively as possible, bailing out on any error or a missing function. If Microsoft ever "delivers" and removes those functions, we simply fall back to the current behaviour of hooking the IAT directly after LoadLibrary.

@CookiePLMonster CookiePLMonster changed the title Partial support for Handling Limit Adjusters Better support for Handling Limit Adjusters and mods loading files from DllMain May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handling merger is incompatible with any handling extenders

1 participant