Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!purdue!bu-cs!dartvax!eleazar.dartmouth.edu!earleh
From: earleh@eleazar.dartmouth.edu (Earle R. Horton)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Patching PrGlue
Message-ID: <14998@dartvax.Dartmouth.EDU>
Date: 12 Aug 89 18:21:32 GMT
References: <3602@uokmax.UUCP>
Sender: news@dartvax.Dartmouth.EDU
Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton)
Organization: Thayer School of Engineering
Lines: 31

In article <3602@uokmax.UUCP> rob@uokmax.UUCP (Robert K Shull) writes:
...
>We're implementing a LaserWriter password system here,
...
>To do this, I've patched PrGlue with an init. I watch for calls to
>PrOpenDoc with the printer being a LaserWriter. No problem so far, everything
>works fine. However, I've already found one program that doesn't go through
>PrGlue (Microsoft Word, of course).

     Word 4.0 calls PrGlue on my Mac II running System 6.0.3.  You
must realize that PrGlue is new with System 4.1, and Word is designed
to work with System 3.2, which didn't have the trap.  In fact, any
program which is sufficiently old would not use the trap.  WriteNow
1.07, for instance, works fine with System 6.0.3 and does not call
PrGlue.

>Does anyone have any ideas, places to patch, people to write, etc.

     You could tell your users to use only the latest versions of
software.  This should guarantee that the PrGlue trap gets called,
since the latest versions of most software almost certainly do call
it.  You could abandon the idea of patching PrGlue, and patch the
LaserWriter driver instead.  Since the LaserWriter driver prints only
in draft mode, 'PDEF' 0 must contain all the entry points for the
printing routines.  You could change the type or ID of this resource,
and replace it with one of your own which does the password checking,
then calls the original code.  MacDTS would probably recommend that
you not do this, but then, they don't recommend patching traps,
either.

Earle R. Horton