Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!tut.cis.ohio-state.edu!uoft02.utoledo.edu!desire.wright.edu!jmatthews From: jmatthews@desire.wright.edu Newsgroups: comp.sys.mac.programmer Subject: Re: trapping for floppy diskDOWN Message-ID: <1991Mar26.231454.3002@desire.wright.edu> Date: 27 Mar 91 04:14:54 GMT References: <1991Mar19.164204.8847@hubcap.clemson.edu> <6761@rex.cs.tulane.edu> <23818@well.sf.ca.us> Organization: University Computing Services, Wright State University Lines: 47 >>>I am working on an init that traps on MountVol. What I want to do >>>is to distinguish between floppies and hard disks. Can anybody help >>>me out? Sample code would be appreciated. Thanks in advance. Here's some code to call the disk driver. The first drive in the queue is currentDrive := GetDrvQHdr^.qHead^.drvQElem; subsequent elements are currentDrive := currentDrive.qLink^.drvQElem; You can call the driver's Control routine thus: function FloppySize (currentDrive: DrvQEl): Integer; var info: Integer; pBlock: ParamBlockRec; begin FloppySize := 0; with pBlock, currentDrive do begin ioVRefNum := dQDrive; ioRefNum := dQRefNum; csCode := 23; {IM V p 470} if PBControl(@pBlock, false) = noErr then begin info := BitAnd(csParam[1], $F); if info = 2 then FloppySize := 400 else if info = 3 then FloppySize := 800 end end end; You might look at bits 8 through 11 for information about whether a drive is SCSI/IWM (bit 9), or fixed/removable (bit 10). The real question: "is the drive queue initialized at INIT time?" o----------------------------------------------------------------------------o | John B. Matthews, jmatthews@desire.wright.edu, am103@cleveland.freenet.edu | | "Say...what's a mountain goat doing way up here in a cloud bank?" - Larson | o----------------------------------------------------------------------------o