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

As I understand it, part of the problem is how to patch SysLibFoo.

Now, please straighten me out if I get this wrong, but for Net lib, getting the
pointer to the entry in the library table can be done with SysLibTblEntry using a
refNum gotten with SysLibFind, right?

Then do you keep the address of the original Net lib table, and then replace the
contents of the original entryP->dispatchTblP with your own table's address (in
which case you had better have every Net lib function in your table)? Then all Net
lib calls go to the new lib, and (presumably) you pass most of them on to Net lib,
and actually only do work in the relatively few functions you really want.

Are there any traps in Net lib that are present after netLibTrapLast, that are
undocumented? I guess we could check the contents of the original net lib table.

When passing a call on to the original function (with or without additional
processing), do you just use the address from the original table, or is there more
to it because of limited jump offsets? Is it reasonable to modify your table at
run
time and just copy the addresses from the original Net lib table into your own
table (for the functions you don't care about)? If I understand things correctly,
you can no longer use traps to get to Net lib after you replace the original
entryP.

Are these the sort of questions that make doing this a 'scary-hairy proposition',
or are there even more issues to deal with?





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