HookAPI return value

c++ / delphi package - dll injection and api hooking
Post Reply
robertsun
Posts: 1
Joined: Thu Sep 29, 2022 6:07 am

HookAPI return value

Post by robertsun »

Hi all,
I wrote a piece of code with madHook to capture some system functions (for example: GetSaveFileNameW). But the call result of HookAPI is not true or false, but - 1. What's the matter? In addition, even if - 1 is returned, the capture is still normal, but it does not take effect immediately. It needs to wait more than ten seconds. Does anyone know why?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: HookAPI return value

Post by madshi »

0 = FALSE; anything else = TRUE. That's how things have always worked. So -1 is TRUE.

Not taking effect immediately seems strange. Do you have more details about that?
Post Reply