[comp.sys.mac.programmer] Patching PDEFs

ahc@sisd.kodak.com (Aleck Che-Mponda CUST) (08/07/90)

I am trying to patch the laserwriter driver (yes, I know it 
must be liscenced, but I need a product first).  I specifically
need to patch the PrJobDialog call so that our device specific
dialog appears.  According to Apple documentation, the call
lies in the code resource PDEF 4 with a jump table offset = 8.
Apple says, "Patching PDEFs is completely UNSUPPORTED."
 
 I'm using LSC 4.0 (BTW, great product, but implementation of
 "malloc" has caused many-a-sleepless nigths).  I have TMON,
 Nosy.  I'm able to merge my code segment into the laserwriter
 driver but I haven't been able to coax the execution of my
 PDEF code segment(which I've numbered #312).

 Has anybody tried to patch code resources?  Could you send me 
 code,theory,etc., I believe it must be done in assembly. I have
 tried placing an address call at the appropriate location 
 (using ResEdit)  but I'm unable to make my code segment be
 referenced by the laserwriter's PDEF 4 jump table.
 [I have copied my DITL's and DLOG's to the LW].

 Nosy gives me the following for the PDEF #4's jump table:

 0: 4eFA 09C4    10009C6 PDEF    JMP     proc32
 4: 4EFA 0290    1000296         JMP     proc17
 8: 4EFA 02A8    10002B2         JMP     proc18  <===
	 ^^^^

What coding is required for my code segment to be called?

All help would be appreciated.
Please E-mail replies to me.  I will summarize to net.

 Che!

Disclaimer:  My employers can not be held responsible for my
ignorance and stupidity.
--
*****************************************************************
Aleck Che-Mponda		ahc@sisd.kodak.com
Software Engineer		amc4023@ma.rit.edu
"A geek, 'and proud of it, man!' "