praydog / REFramework

Scripting platform, modding framework and VR support for all RE Engine games
https://cursey.github.io/reframework-book/
MIT License
2.93k stars 358 forks source link

DLL_PROCESS_DETACH does not occur in native plugin #712

Closed Sentox6 closed 1 year ago

Sentox6 commented 1 year ago

Not necessarily a bug report per se, but a behavioural issue I don't quite understand. I'm trying to write a simple plugin that performs actions upon game startup and shutdown (which do not require any REFramework API functionality).

What I've found is that DLL_PROCESS_DETACH never happens when the game shuts down. While I don't think (from a cursory glance) that REFramework calls FreeLibrary(), I was under the impression Windows would still trigger this event when unloading the calling process' address space.

Sentox6 commented 1 year ago

Upon further investigation, using an independent proxy DLL (proxying version.dll), this behaviour seems to be a general issue (at least with RE4 Remake) and not related to REF.