Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!uupsi!sunic!isgate!krafla!frisk From: frisk@rhi.hi.is (Fridrik Skulason) Newsgroups: comp.os.msdos.programmer Subject: Re: Notice diskchange Message-ID: <3052@krafla.rhi.hi.is> Date: 16 Apr 91 21:48:15 GMT References: Reply-To: frisk@rhi.hi.is (Fridrik Skulason) Organization: University of Iceland (RHI) Lines: 33 In article sverrehu@ifi.uio.no (Sverre H Huseby) writes: >How can I make my program aware that a diskette >has been removed from a drive, and a new one >inserted instead? Hm - I was looking at a related problem - how to make my virus scanner automatically scan all diskettes inserted, and here is the conclusion I reached: On a PC (or PCjr) you simply cannot do this - there is no way to know if the diskette has been replaced with an identical one. On most XTs, all ATs, '386 etc.... it is fairly easy... MOV DL, drive MOV AH,16H INT 13H CMP AH,6 JE diskette_changed Either do this in the timer interrupt (if you are not in the INT 13H routine at the moment), or intercept INT 13H, and do this before doing any reads/writes... See the interrupt list from Ralf Brown for further information. -frisk Fridrik Skulason University of Iceland | Technical Editor of the Virus Bulletin (UK) | Reserved for future expansion E-Mail: frisk@rhi.hi.is Fax: 354-1-28801 |