home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!yale.edu!jvnc.net!princeton!rutgers!uwvax!zazen!uwec.edu!nyeda
- From: nyeda@cnsvax.uwec.edu (David Nye)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: LASTDRIVE function/asm/ect... Need one!
- Message-ID: <1992Nov8.155834.2200@cnsvax.uwec.edu>
- Date: 8 Nov 92 21:58:34 GMT
- References: <1992Nov8.081922.15576@ra.msstate.edu>
- Organization: University of Wisconsin Eau Claire
- Lines: 15
-
- There is source code for this in the disk that accompanies the book
- Undocumented DOS by Andrew Schulman et al. Every programmer who
- writes under DOS should have a copy. I don't think the code is PD
- so I can't post it. Basically, you call Int 21h fn 19h to get the
- current drive and then Int 21h fn 0Eh to select that drive. As a
- byproduct of doing this, LASTDRIVE is returned in AL. Bear in mind
- that LASTDRIVE does not contain the number of drives in the system,
- only the size of the array built to hold disk information (the
- Current Directory Structure array). There often are fewer drives
- than LASTDRIVE, and may be more if the machine is networked. The
- only reliable way to actually count drives is to walk the Drive
- Parameter Block chain.
-
- David Nye
- nyeda@cnsvax.uwec.edu
-