Return value of HookAPI

contains all delphi packages mentioned below
Post Reply
manutai
Posts: 85
Joined: Sun Aug 03, 2008 1:40 am

Return value of HookAPI

Post 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 !!
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Return value of HookAPI

Post by madshi »

The HookAPI() return value is a boolean. By definition 0 is false. Everything else is true.
manutai
Posts: 85
Joined: Sun Aug 03, 2008 1:40 am

Re: Return value of HookAPI

Post 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?
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Return value of HookAPI

Post by madshi »

Is Ole32.dll loaded in the moment when you call HookAPI()?
Post Reply