Without your relevant code fragments? No chance we could even guess what you have done, much less what is wrong with it.
And even with, there is a good chance that we can't do much - without running your code it's probably impossible to tell what is going on, and I for one do not want to start running hooking code that I know crashes on my dev machine - I have no idea what it is doing or even that it's not malicious! Bear in mind that it's really easy to get an unstable system with bad hooking code!
So it's going to be up to you, and that's going to mean some pretty solid WinDbg knowledge.
YOu may find some hints here: WinDbg Hooking
] - but I suspect that most of 'em are going to be "paid for" courses.