Question about LhInstallHook function

Mar 28, 2011 at 10:11 PM

I am building unmanaged code around EasyHook

I was looking into the documentation of LhInstallHook function and I can't understant the last two arguments?

The 3rd argument is called InCallback, what should this be? Just a callback function in C++? If yes, any specific signature or what?!

The 4th argument is called OutHandle, what is this one as well? I read it's just a buffer to receive some result, what kind of buffer is this? Does it need to have specific format or size?


Thanks and please let me know if you have any answers for this


Apr 1, 2011 at 3:14 PM

Callback is arbitrary pointer which you can retrieve and use from your proxy function.

OutHandle is pointer to HOOK_TRACE_INFO variable which must exist for entirety of hook lifetime (by been allocated in heap, for example). It is "handle" to "hook" by which you can refer to hook itself and uninstall it, for example.

Apr 1, 2011 at 9:26 PM

Sorry, can you give me an example on the 3rd parameter? I still do not get it

Apr 2, 2011 at 4:25 PM

Just send NULL.