SQLite Forum

[Windows] SQLite dll hooking is nearly impossible due to recursive calls
Login
> And how to solve this problem?

Have you already rejected [SQLite's existing tracing and profiling mechanisms][1]? And if so, why?

DLL hooking is a technique that was created in a world where most DLLs didn't have source code available, so it was the next best option available. Unless your tracing facility *must* work on DLLs that others provide only in binary form, you'd probably be able to get around your current limitations by modifying SQLite itself, since that would give you access to the internal state variables that let you suppress output when SQLite is just calling back into itself.

[1]: https://sqlite.org/c3ref/profile.html