peter@wacsvax.OZ (Peter Dodd) (05/28/90)
Hello - this may save someone some development time. We have recently developed an INIT to restrict access to network printers. The INIT installs a ToolBox trap in the system heap at startup time. The installed code is a patch to the PrGlue trap - at print time, it determines whether the user has correct privileges to use the selected printer. The problem we encountered lies in the use of the Print Manager by some applications. We can live with the fact that the older applications don't use the PrGlue routine described in Inside Macintosh Vol V, hence don't even "see" our patch. Of the applications which DO use the PrGlue routine, some implement their own dialog to replace the standard PRJobDialog routine (which is reasonable), but some applications do not check the retured value of routines such as PrOpenDoc, or test the value of PrError. This seems to make it impossible to write a general Print Manager trap which can perform the desired checking in a regular way with all applications. Peter Dodd Andrew D. Nielsen peter@wacsvax.cs.uwa.oz.au Nielsen_AD@cc.curtin.edu.au
kaufman@Neon.Stanford.EDU (Marc T. Kaufman) (05/28/90)
In article <1594@wacsvax.OZ> peter@wacsvax.OZ (Peter Dodd) writes:
-We have recently developed an INIT to restrict access to network printers.
-The INIT installs a ToolBox trap in the system heap at startup time.
-The installed code is a patch to the PrGlue trap - at print time, it determines
-whether the user has correct privileges to use the selected printer.
-The problem we encountered lies in the use of the Print Manager
-by some applications. We can live with the fact that the older applications
-don't use the PrGlue routine described in Inside Macintosh Vol V,
-hence don't even "see" our patch...
Some applications (notably PageMaker and FreeHand) don't use EITHER PrGlue
or the old calls. They have their own drivers built in, and just use the
Resources from the standard LW driver. Hence, patching PrGlue in this way
is doomed to failure. Why not patch the Chooser and make the restricted
printers never appear in the list of printers?
Marc Kaufman (kaufman@Neon.stanford.edu)