Eric Siu wrote:
>
> // Reset the system Trap Address
> if (cardNo==cardNoToDelete && dbID==dbIDToDelete) {
> SysSetTrapAddress(0xA2E2, oldKeyboardPtr);
> SysSetTrapAddress(0xa042,oldDmDeletePtr );
> }
> return DmDeleteDatabase(cardNoToDelete,dbIDToDelete);
> }
>
> the problem is taht when it do (dbID==dbIDToDelete), it cause a bus error.
> when I just compare the cardNo, it works.
> can anybody help me ?
Since this is being called when your program is not active,
you have no access to your globals oldKeyboardPtr and
oldDmDeletePtr. (I'm assuming they're globals since I didn't
see how you declared them in the source that you posted.)
You'll need to store them in a different way (like using the
feature manager with FtrSet/Get) to have access to them when
your patched sysTrap is called.
FWIW, why not just do this in a HackMaster hack? HackMaster
will take care of setting the sysTraps back to their original
values.
Regards,
Daniel.