home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- 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
- From: Ken Wieschhoff <kenw@ssd.kodak.com>
- Subject: Re: how to put indelible serial# in resource fork of app?
- Message-ID: <1992Jul23.145152.2441@pixel.kodak.com>
- Sender: news@pixel.kodak.com
- Organization: Eastman Kodak Company
- X-Useragent: Nuntius v1.0
- References: <Jul.20.17.18.21.1992.16265@gandalf.rutgers.edu>
- <14kh9qINNds5@agate.berkeley.edu> <peter-230792103333@134.7.50.3>
- Date: Thu, 23 Jul 92 14:51:52 GMT
- Lines: 35
-
- A good way to keep users from running software from servers is to disable
- the capability completely. When an application is started, doing a
- GetVol( volumeName, &fVRefNum); when the app launches retrieves the
- volume reference. Use the following routine to determine if a vol ref is
- a network volume.
-
- pascal Boolean IsNetworkVolume( short vRefNum)
- {
-
- HParamBlockRec pb;
- GetVolParmsInfoBuffer info;
- OSErr err;
-
- // Flag mask for vMAttrib field
- const long bExtFSVol = 1L << 16;
- pb.ioParam.ioCompletion = NULL;
- pb.ioParam.ioVRefNum = vRefNum;
- pb.ioParam.ioNamePtr = NULL;
- pb.ioParam.ioBuffer = (Ptr) & info;
- pb.ioParam.ioReqCount = sizeof(GetVolParmsInfoBuffer);
-
- // Get volume info
- err = PBHGetVolParmsSync( &pb);
-
- // Check this for a network volume.
- if ((info.vMServerAdr != 0) && (err == noErr))
- return true;
- else
- return false;
- }
-
-
- Kenneth H. Wieschhoff, Jr. | "If you want to f*** with
- (716)426-3317(w) | the Eagles, you gotta learn
- kenw@ssd.kodak.com | to fly" -->Heathers
-