Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!hacgate!ashtate!dbase!cy From: cy@dbase.A-T.COM (Cy Shuster) Newsgroups: comp.sys.mac.programmer Subject: Re: How to tell if a volume is a floppy drive? Message-ID: <690@dbase.A-T.COM> Date: 30 Aug 90 20:38:28 GMT References: <1517@ntmtv.UUCP> <9794@goofy.Apple.COM> <7796@gollum.twg.com> <9874@goofy.Apple.COM> <3900@wucc.waseda.ac.jp> Reply-To: cy@dbase.UUCP (Cy Shuster) Organization: Ashton Tate Development Center Glendale, Calif. Lines: 25 In article <3900@wucc.waseda.ac.jp> 60d006@wucc.waseda.ac.jp (Kazuaki Ishizaki) writes: >Please tell me "how can you tell if it is an AppleShare volume?" > >P.S. I tried to use PBHGetVolParms. But if I execute this function > when an AppleShare volume is mounted, this program is hang up.... It works, believe me. You need to completely clear out to zero the PB block you're passing, then set the ioVRefNum, set ioBuffer to point to a buffer you've created to hold the return result, and set ioReqCount to the size of the buffer you're passing in: initPB(); /* sets block to all zeros */ pb.hr.ioParam.ioVRefNum = myRefNum; pb.hr.ioParam.ioBuffer = &SEEioBuffer; pb.hr.ioParam.ioReqCount = sizeof(SEEioBuffer); myErr = PBHGetVolParms(&pb.hr, FALSE); /* check for errors */ if (SEEioBuffer.vMAttrib & bHasOpenDeny) /* then it's a shared volume */ See Inside Mac for the formats of SEEioBuffer. Always clear out your PB blocks: before every call! --Cy-- cy@dbase.a-t.com