At 4:30 PM -0700 1999/05/25, Jeff Ishaq wrote:
>What happens here?  How does the OS get from this point to looking into
>GSysLibTableP[myRefNum], and calling the fifth function in my lib's dispatch
>table *dispatchTblP[5]?
>
>Maybe the most elusive question of all is, how does it know which refNum's
>SysLibTblEntry to use?  Surely I'm not the only shared library that could be
>using sysLibTrapCustom one of its function's trap ID's.  Wouldn't that
>generate the same code when run through SYS_TRAP?  I think so.

The first parameter of each library function must be the library reference number. The 
library trap dispatcher pops this off the stack and uses it as the index into the 
loaded library table. All your library traps MUST start with sysLibTrapBase 
(sysLibTrapCustom for your custom APIs past the four required entrypoints) or else the 
dispatcher won't know that it's a library trap.

If you're wondering why your CodeWarrior disassembly shows the wrong trap number, it's 
because it's using the trap list for the Mac OS, not the Palm OS.

Regards,

Jim Schram
3Com/Palm Computing
Partner Engineering

Reply via email to