I need information on how to hook a common dll api. I notice you say not to reuse the hook or the hook next pointers. I have the problem that I'm trying to hook common api in a lot of dlls. For instance supposed I have defined the function:
GetInfo
This functions is defined in muliple dlls that I want to hook. Do I need to create separate functions for each one of these dlls or is there some type of array of pointers I can use. And if this can be done is there an API that I can call to know what dll this hook is from.
Common DLL Api
The NextHook procedure variable can definately not be shared between multiple API hooks. You need one NextHook procedure variable for each API hook you want to install. If the hook callback function does not use/mention NextHook at all, then you can get along with one hook callback function for all similar API hooks. But as soon as your hook callback function is meant to use/call NextHook, you need one hook callback function per API hook, too. No way around that.