home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ornl!sunova!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!apple!apple!NewsWatcher!user
- From: rol@grasp1.univ-lyon1.fr (Paul Rolland)
- Newsgroups: alt.lang.asm
- Subject: Re: LASTDRIVE function/asm/ect... Need one!
- Message-ID: <rol-171192133911@90.222.1.80>
- Date: 17 Nov 92 12:36:56 GMT
- References: <1992Nov8.081922.15576@ra.msstate.edu>
- Sender: usenet@Apple.COM
- Followup-To: alt.lang.asm,comp.lang.pascal,comp.os.msdos.programmer,comp.sys.ibm.pc.programmer
- Organization: Apple Computer Europe
- Lines: 58
-
- In article <1992Nov8.081922.15576@ra.msstate.edu>, jdz1@Ra.MsState.Edu
- (John D. Zitterkopf) wrote:
- >
- > Howdy,
- >
- > As the subject says, I'm looking for some references on how to find
- > the LASTDRIVE on a particular system. Something like a INTerrupt or source
- > code that will allow me to do this. I did my best to search an interrupt list
- > to come up with a solution to do this but no luck. For Example, My lastdrive
- > is G, I'd like to make a TP6.0 function called LASTDRIVE that would return
- > a byte value of 7 or so. If it's in Assembly, I can convert it, ect.
- > A function to also tell me if the drive number is valid or not could
- > also prove useful.
- > I know these types of things are done becuase PC-TOOLS and the like
- > figure it out and even find the correct drive type.
-
- Here is some code that I use to get LastDrive. It does use the call to
- subfunction 60h which is undocumented, but it works fine with all the
- version of DOS that I've tested. It is used to get the real path associated
- to a disk (useful to detect SUBSTed disk, or network disk). As a result,
- you
- have in LastDrive the result of the DOS LastDrive, and in LastPhysDrv the
- name of the last PHYSICAL drive, that is to say a disk that really exist
- (not a substed one !).
- Tested with NOVELL network.
-
- Mov Ah,19H
- Int 21H
- Mov Byte Ptr Ds:[CurrentUnit],Al
- Mov Dl,Al
- Mov Ah,0EH
- Int 21H
- Mov Byte Ptr Ds:[LastDrive],Al
- Add Al,40H
- Mov Word Ptr Ds:[Buffer+1],'\:'
- Mov Byte Ptr Ds:[Buffer+3],0
- GLLoop: Mov Byte Ptr Ds:[Buffer],Al
- Mov Si,OffSet Buffer
- Mov Di,OffSet Buffer+10H
- Mov Ah,60H
- Int 21H
- Mov Al,Byte Ptr Ds:[Buffer]
- Cmp Al,Byte Ptr Ds:[Buffer+10H]
- Jz GLEnd
- Dec Al
- Jmp Short GLLoop
- GLEnd: Sub Al,40H
- Mov Byte Ptr Ds:[LastPhysDrv],Al
-
- Paul Rolland, rol@grasp1.univ-lyon1.fr
- ---
-
- A bug can be changed to a feature by documenting it. Developpers know !
-
- --------------------- DISCLAIMER -------------------
-
- All the opinions I express in this posting are mine, but I'm
- ready to share them with anybody interested :-)
-