Page 1 of 1

Return value of HookAPI

Posted: Mon Nov 11, 2013 7:00 am
by manutai
I want to know in which all scenarios HookAPI function return '-1'.
I am using madcodehook 3.1.5.

I hooked a function which is not part of a particular DLL, HookAPI returned -1.
Now, I hooked a function which is part of that DLL, it returned -1 again.

So, Is -1 success or failure ??

Please reply !!

Re: Return value of HookAPI

Posted: Mon Nov 11, 2013 8:29 am
by madshi
The HookAPI() return value is a boolean. By definition 0 is false. Everything else is true.

Re: Return value of HookAPI

Posted: Mon Nov 11, 2013 8:50 am
by manutai
So, If I m trying to hook say CreateFileW in Ole32.dll (which is a erroneous case),
it should return 0, but it is returning -1.
What do you make of that?

Re: Return value of HookAPI

Posted: Mon Nov 11, 2013 9:05 am
by madshi
Is Ole32.dll loaded in the moment when you call HookAPI()?