Hook more than 128 API

Jun 10, 2009 at 7:38 AM

When I hook more than 128 API, the call to LhInstallHook and to LhSetExclusiveACL failed.  Any comments.

Jun 20, 2009 at 8:37 PM

this is the preset limit because EasyHook always has to reserve memory for the whole possible hook count, even if you only apply one.

Just walk through the code and find the point where LhInstallHook fails. Then you should find a constant referring to the hook limit. Just change it to the value you need.

Jun 22, 2009 at 7:15 AM

Thanks Chris,  I found the constant according to your advice.

Aug 19, 2009 at 4:51 PM

I'm having a different version of the same problem.

I need to install/uninstall 4 hooks on an as-needed basis during the lifetime of a process.  The number of times I need to install/uninstall is unbounded, but I only need 4 hooks active at any one time.

After 32 install/uninstall sequences, I can no longer install any more hooks, receive the STATUS_INSUFFICIENT_RESOURCES return code, even though no hooks are installed at the time of the call.

Any ideas as to the problem?

May 7, 2010 at 9:38 PM

One suggestion would be to leave the 4 hooks in place, but to change the hook ACL's as-needed.

Nov 19, 2014 at 4:36 PM
Got to love foonson "I found the constant according to your advice."
Well.... where did you find it man? lol :D

Anyways, for those of you left on the cliff hanger like I was, I've found this constant as well. Its called MAX_HOOK_COUNT and its found in the easyhook.h header file.