home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12926 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.6 KB  |  49 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!think.com!spdcc!dirtydog.ima.isc.com!newsserver.pixel.kodak.com!news
  3. From: Ken Wieschhoff <kenw@ssd.kodak.com>
  4. Subject: Re: how to put indelible serial# in resource fork of app?
  5. Message-ID: <1992Jul23.145152.2441@pixel.kodak.com>
  6. Sender: news@pixel.kodak.com
  7. Organization: Eastman Kodak Company
  8. X-Useragent: Nuntius v1.0
  9. References: <Jul.20.17.18.21.1992.16265@gandalf.rutgers.edu>
  10.      <14kh9qINNds5@agate.berkeley.edu> <peter-230792103333@134.7.50.3>
  11. Date: Thu, 23 Jul 92 14:51:52 GMT
  12. Lines: 35
  13.  
  14. A good way to keep users from running software from servers is to disable
  15. the capability completely.  When an application is started, doing a
  16. GetVol(  volumeName, &fVRefNum); when the app launches retrieves the
  17. volume reference.  Use the following routine to determine if a vol ref is
  18. a network volume.
  19.  
  20. pascal Boolean IsNetworkVolume( short vRefNum)
  21. {
  22.  
  23.     HParamBlockRec pb;
  24.     GetVolParmsInfoBuffer info;
  25.     OSErr err;
  26.  
  27.     // Flag mask for vMAttrib field
  28.     const long bExtFSVol = 1L << 16;
  29.     pb.ioParam.ioCompletion = NULL;
  30.     pb.ioParam.ioVRefNum = vRefNum;
  31.     pb.ioParam.ioNamePtr = NULL;
  32.     pb.ioParam.ioBuffer = (Ptr) & info;
  33.     pb.ioParam.ioReqCount = sizeof(GetVolParmsInfoBuffer);
  34.     
  35.     // Get volume info
  36.     err = PBHGetVolParmsSync( &pb);                
  37.  
  38.     // Check this for a network volume.
  39.     if ((info.vMServerAdr != 0) && (err == noErr))
  40.         return true;
  41.     else
  42.         return false;
  43. }
  44.  
  45.  
  46. Kenneth H. Wieschhoff, Jr.    | "If you want to f*** with 
  47. (716)426-3317(w)            | the Eagles, you gotta learn
  48. kenw@ssd.kodak.com            | to fly"  -->Heathers
  49.