EvtEnqueueKey is often called at interrupt time (especially in
response to a button press), and FtrGet is NOT interrupt safe.
That is, if the MemoryMgr semaphore is not available, (such as might
be the case if you were scrolling fast and causing screen updates,
database lookups, or anything else that uses the MemoryMgr) then your
patch will fail.
Bottom line: Don't patch EvtEnqueueKey.
--Steve
At 4:39 PM +0000 5/6/99, [EMAIL PROTECTED] wrote:
>I am trapping EvtEnqueueKey for a Hackmaster hack I am working on however I
>have a problem. It seems that if I trap this call it causes a strange bug.
>
>If I activate this hackmaster trap and then run Datebook and press the
>scroll button very fast many time (like 25 or so) it will crash with a
>Fatal Error dialog with no Fatal Error message details.
>
>To evaluate this bug I changed my trap to do nothing just immediatly pass
>the call on to the original trap.
>
>If I put the code in to take the action I want it works fine so long as
>you do not press the buttons extreemly fast. Anyone have any ideas as
>to why this might happen. Is this my bad or a problem with HackMaster ?
>
>A snipit of code is presented below to help anyone that can provide so
>assistance.
>
>This hack has no other traps and as you can see below it currently does
>absoultly nothing but still causes the crash.
>
>=======================================================================
>typedef Err (*myInterface)(UInt ascii, UInt keycode, UInt modifiers);
>
>//Prototype
>Err MyEvtEnqueueKey(UInt ascii, UInt keycode, UInt modifiers);
>
>Err MyEvtEnqueueKey(UInt ascii, UInt keycode, UInt modifiers)
>{
> myInterface oldTrap;
> DWord value;
>
> FtrGet(myCreator,myResID,&value);
> oldTrap=(myInterface) value;
> return oldTrap(ascii,keycode,modifiers);
>}
>=======================================================================
>
>Ron Gouldner
>http://www.rgps.com
>email:[EMAIL PROTECTED]