[comp.sys.mac.programmer] Patching _Pack3

wras@walt.cc.utexas.edu (Steve Mariotti) (04/09/90)

Hi,
	I'm having great difficulty with the simplest thing and was hoping
that someone could help me see the light.
	Basically, I'm writing an INIT (a very short one) that patches the
standard file package to ensure all standard file operations are done on the
internal drive (drive 1).  The reasons for this are difficult to explain, as
they have something to do with the network setup where I work.  At any rate,
I have to have something memory resident that will ensure the default drive
for all standard file operations is the internal one so that it automatically
loads and saves from there.
	The init installs the patch perfectly, and the patch seems to work for
*some* programs (pagemaker, white knight, digi-sim, and others) but bombs
horribly for Microsoft Word 4.0 and Excel 1.5!  I've traced thru the code with
TMON and everything *seems* to be working fine in the patch (dispatch works,
patch executes, and it exits properly).  Could I be messing up some registers
that MS Word and MS Excel need?  I restore the stack to the same state as when
the patch is entered.  

	Here's my method.  When the patch is called (via the _Pack3 trap)
It does a GetVInfo(1,&string,&vRefNum,&freespace) and then if the errorcode
returned is NoErr, it does a SetVol(string,vRefNum) followed by storing
the vRefNum in CurDirStore and SFSaveDisk (though it stores the negative
of the vRefNum in SFSaveDisk).

	Even in MS Word and MS Excel I can tell it makes the internal current
as I hear it run a bit before the crash.  This means that the Mac exits my
patch fine and continues with the old _Pack3 routines before crashing (nothing
I do would run the drive).

	This is very perplexing, and I was wondering if anyone knew anything
about Microsoft products regarding the SFpackage.  Like I said, it works
fine with Pagemaker 3.01 and many other programs I have, but it's imperative
that it work with Word.

Thanks alot in advance

Steve Mariotti




 ______  _____________________________________________________________________
| ____ |   The opinions expressed above are barely even those of the author.  |
||    || ---------------------------------------------------------------------|
||    ||    Steve Mariotti -- University of Texas at Austin -- CS Undergrad   |
| ---- | ---------------------------------------------------------------------|
|.  -- | wras@ccwf.cc.utexas.edu -- csar242@ix1.cc.utexas.edu -- AOL:SteveM16 |
|______| ----------------------+----------------------------------------------|
|______| * Forever Macintosh * |    "I have no response to that!" --Meg Ryan  |