"Adam Wozniak" <[EMAIL PROTECTED]> wrote in message
news:7736@palm-dev-forum...
> Correct me if I'm wrong, but I don't believe you've ever tried this.
>
> The dispatch table ends at sysTrapLastTrapNumber.  There are no entries
> for libraries, which is why SysGetTrapAddress() and SysSetTrapAddress()
> don't work for library functions.

Each library has its own dispatch table. I think Joe was suggesting that you
modify the dispatch table for the library.

For example, if you wanted to intercept the "open" function for the IR
Library, you could find the entry for the IR Library in the system's array
of open libraries using the reference number as an index. This entry
contains a pointer to the dispatch table as well as a pointer to the
library's globals. The first entry for all libraries is a pointer to the
library name. The second is "open", so you'd modify the second function
pointer in the dispatch table to point to your own hacked version of the
"open" function.

For the IR Library, you'd only have to do this once because the library is
loaded at reset and never unloaded. For libraries that are loaded and
unloaded dynamically, you'd have to intercept the trap for loading the
library so you could patch the library's dispatch table after the library
sets it up.
--
Danny Epstein
OS Engineer, Palm Inc.


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

Reply via email to