Open gir489returns opened 3 days ago
A Special K plugin is just any DLL that you produce. Special K will load the DLL in such a way as to cause DllMain
to be invoked. You'll likely want to spawn a thread in DllMain
to do anything interesting. There isn't a simple way to do much interaction with Special K itself from within your plugin, although there are various complicated ways, such as finding the Special K module in the address space of the process and invoking functions that are exported by the Special K module.
Once upon a time Special K had a proper ABI used by external DLL based plugins but over time that transitioned into becoming a more internal part of the codebase. Instead, the command console was exposed externally at one point, to allow for third-party DLL plugins to engage with Special K's internals.
But most "third-party DLL plugins" are as cathyjf mentioned just normal DllMain based DLLs that SK loads through a normal LoadLibrary call.
There doesn't seem to be a good or accurate depiction of a real SpecialK plugin at least that I can find. All of the ones in the repo are hard dependent on being compiled into/with the project. There also doesn't seem to be very many ways of making a purely abstract DLL, things like toast notifications and interface implementations have to be hard-coded with macros that SpecialK uses, instead of external calls to the actual runtime DLL, this creates the potential for code rot, as instead of making a microservices-like project, you've created a tightly coupled dependency.