Return value of HookAPI

contains all delphi packages mentioned below

Return value of HookAPI

Postby manutai » Mon Nov 11, 2013 7:00 am

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 !!
manutai
 
Posts: 79
Joined: Sun Aug 03, 2008 1:40 am

Re: Return value of HookAPI

Postby madshi » Mon Nov 11, 2013 8:29 am

The HookAPI() return value is a boolean. By definition 0 is false. Everything else is true.
madshi
Site Admin
 
Posts: 9265
Joined: Sun Mar 21, 2004 5:25 pm

Re: Return value of HookAPI

Postby manutai » Mon Nov 11, 2013 8:50 am

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?
manutai
 
Posts: 79
Joined: Sun Aug 03, 2008 1:40 am

Re: Return value of HookAPI

Postby madshi » Mon Nov 11, 2013 9:05 am

Is Ole32.dll loaded in the moment when you call HookAPI()?
madshi
Site Admin
 
Posts: 9265
Joined: Sun Mar 21, 2004 5:25 pm


Return to madCollection

Who is online

Users browsing this forum: No registered users and 6 guests

cron