Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hooking Windows APIs

0 views
Skip to first unread message

Amir Idan

unread,
Jan 13, 1997, 3:00:00 AM1/13/97
to

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.

All help is highly appreciated.
Thankyou.

Robert Lafond

unread,
Jan 21, 1997, 3:00:00 AM1/21/97
to

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

user

unread,
Jan 21, 1997, 3:00:00 AM1/21/97
to


But to actually "hook" an api call rather than a message you will either
need to create a VxD in Windows 95 or a Device Driver in Windows NT.
Although these methods hook the api calls globally. So if you only need to
hook within an application that you have control of it's overkill.

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.

-Mike
mi...@frontiertech.com

> >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.
> >

David Taliaferro

unread,
Jan 28, 1997, 3:00:00 AM1/28/97
to

The other reply to this posting was referring to hooking windows messages,
which is easy (with the Win32 SetWindowsHookEx() function.)

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.
>

0 new messages