How can I hook (or "chain") Win API functions?
I need to substitute an API function with my own, saving some params and
stuff, and then calling the original API.
All help is highly appreciated.
Thankyou.
You can intercep just about every messages sent by the system and
have your app process it, after which you can call the default handler
for this message and let the system do its normal processing.
Hope its of any comfort.
Robert
This was much easier in Win16 because you could just use
AllocCsToDsAlias(might have been AliasCsToDsAlias but I forget). Of course
this creates the problem of self modifying code but no one said it was
going to be easy. :-) Note that this function was undocumented and was
not carried over in Win32.
> >How can I hook (or "chain") Win API functions?
> >
> >I need to substitute an API function with my own, saving some params and
> >stuff, and then calling the original API.
> >
I think you're asking about hooking functions, not messages, which is much
harder, especially if you're doing it under win32. Matt Pietrek's "Under
The Hood" column in the December 96 MSJ describes how to do it.
Hope this helps!
- Dave
Amir Idan <amir...@mail.finjan.com> wrote in article
<32DA0B...@mail.finjan.com>...
> Hello all!
>
> How can I hook (or "chain") Win API functions?
>
> I need to substitute an API function with my own, saving some params and
> stuff, and then calling the original API.
>