It can be done, but not in a supported fashion. I can think of two totally gross
ways of doing this.

One approach would be to replace the trap dispatcher with one of your own. This
trap dispatcher would be looking for dispatch numbers with the right values
(A801, A802, etc.), and for the appropriate library refNum on the stack.

Another approach you could take is patch the SysLibFoo calls so that when the
library you want to patch is loaded, you then replace it's library table entry
with one of your own that wraps it.  That way, all calls for that library come
to you. You can then do whatever you want, call the original function, and then
do any post-processing you want. This approach is requires getting the pointer
to the library table from system globals (which is unsupported) and finding and
replacing the library table entry (which is system-dependent, since the entry
format has changed over time).

All in all, it's a scary-hairy proposition. The best solution is for you to
convince yourself that you *don't* need to patch those functions.

-- Keith Rollin
-- Palm OS Emulator engineer





gcw <[EMAIL PROTECTED]> on 10/03/2000 01:16:35 AM

Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>

Sent by:  gcw <[EMAIL PROTECTED]>


To:   "Palm Developer Forum" <[EMAIL PROTECTED]>
cc:    (Keith Rollin/US/PALM)
Subject:  trapping TrapIDs over A800




I need to trap the system calls SysLibOpen, SysLibClose, etc. ( they
have trap IDs over A800 apparently).  Unfortunately, the call
SysSetTrapAddress() doesn't seem to let me set traps for trapIDs over
the value of the constant "sysTrapLastTrapNumber", which is A3E8.    Is
it possible to patch the generic system library calls?





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to