If you just want to modify the behavior of a few calls, there is a
possibly easier way.

All libraries use the same trap numbers for entry points.  That is way
all library calls require a 'lib ref' parameter.  The ref. determines
which library is actually invoked via a function table.  If you just
wanted to modify one or two functions, you could replace those two
traps, saving the original trap address off in a feature.

Then, each time your replacement trap(s) is called, check the library
reference.  If it is not the library you are augmenting, just pass the
trap on.  If it is the library you are augmenting, do your encoding,
then pass it on.

You might also want to look at virtual drivers.  They are intended to
add the kind of 'hidden' protocol support you are talking about.

Best Regards,
-jjf

-----Original Message-----
From: Eric [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 09, 2000 11:44 PM
To: Palm Developer Forum
Subject: how to trap system library functions?


    I want to add some encoding in data send out via serial and ir port.
but the functions of these 2 areas are library base, I found that it is
difficult to trap them. Greg Winton tell me that "1. hack the SysLibFind
trap and look for someone trying to load IR,
 2. then load your own version instead.",
the first step is not difficult to do, for the second step, I got
difficulty. anyone good guy help me?!

Eric



-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to