Hooking

c++ / delphi package - dll injection and api hooking
Post Reply
manutai
Posts: 85
Joined: Sun Aug 03, 2008 1:40 am

Hooking

Post by manutai »

Does Hooking a function serializes the call to it in the application, if the same function is called by different threads?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Hooking

Post by madshi »

No. Hooking is thread independent and (as far as madCodeHook is concerned) thread safe. Which means that if two different thread call the hooked API at the same time, also your hook callback function is called at the same time, in the context of those 2 different threads. It's your responsibility to make sure that your hook callback functions are written in a thread safe manner. E.g. avoid accessing global resources. Or if you do need access to global resources, use a critical section to serialize access.
Post Reply