home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20203 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!rpi!gatech!news.ans.net!cmcl2!panix!rmah
  3. From: rmah@panix.com (Robert Mah)
  4. Subject: Problem with patch to HFSDispatch
  5. Message-ID: <1992Dec22.182710.26751@panix.com>
  6. Date: Tue, 22 Dec 1992 18:27:10 GMT
  7. Organization: PANIX Public Access Unix, NYC
  8. Lines: 33
  9.  
  10. In an extension that works fine on most systems, but some people seem to 
  11. be getting freezes when they shut down/restart their machine.  I'm not 
  12. sure, but I think it might be related to my patching HFSDispatch.
  13.  
  14. I'm using register a1 to hold the adress of the real trap -- is there
  15. something wrong with this?  Anyone care to comment?
  16.  
  17. Some code...
  18.  
  19. /* 
  20.  *  We need to trap whenever the user moves a directory (selector 5).
  21.  */
  22. pascal void FSDispatchPatch()
  23. {
  24.     asm{
  25.         movem.l  a4, -(sp)                 ; save registers
  26.         lea      main, a4                  ; setup globals
  27.         cmp.w    #5, d0                    ; if not CatMove
  28.         bne.s    @1 
  29.         move.w   #1, gNeedsUpdate          ; set the gNeedsUpdate flag
  30. @1      move.l   realHFSDispatchTrap, a1   ; grab the addr of the real thing
  31.         movem.l  (sp)+, a4                 ; restore registers
  32.         jmp      (a1)                      ; jump to real HFSDispatch
  33.     }
  34. }
  35.  
  36. Happy Holdiays,
  37. Rob
  38. -- 
  39. [--------------------------------------------------]
  40. [  Robert S. Mah   |  "Every day an adventure,     ]
  41. [  rmah@panix.com  |   every moment a challenge."  ]
  42. [--------------------------------------------------]
  43.