It would not be difficult to make HookAPI() not crash, it's just one API, but I'd have to add the same check to each and every exported function, and in Delphi that's a lot more than madCHook.h contains. So a lot of work and added code, just to protect against incorrect usage? Not sure if I like that...
I understand it is incorrect usage, but I spent several minutes trying to understand why I have crash in some irrelevant address.
My opinion that callee will do as much checks as possible, while you say it is not really necessary.
I already made a class which does this automatically, so I won't forget
Btw, perhaps you need some C++ API on top of your header which will take care of all this initializations.
Is it something that you would accept as patch ?
Anyway, how complicated is your C++ API? Does it fit into a single e.g. *.h file?
Maybe in the future I'll do wrapping which will initialize madCodeHook automatically on first call if wasn't initialized before or smth like that.