CDS: Current Directory Structure
This is the undocumented format of a structure DOS maintains for each
logical drive (as set via the LASTDRIVE= command in CONFIG.SYS).
Use DOS fn 52H (get ListOfLists) to locate the first of these structures
and to find how many there are. The second follows directly after the
first, and so forth.
Offset Size Contents
▀▀▀▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
+0 67 szPath ASCIIZ▲ d:\path of current default directory
+43H 2 rFlags bit-flags describing this drive
+45H 4 pfDPB FAR address of the DPB for this drive
+49H 2 wClustNo cluster number of start of default dir
or FAR address of a network redirector record
+4bH 4 pRes unknown; always ffffffffH
+4dH 2 wNetUsrCode network user code as stored via fn 5f03H
+4fH 2 wSlashOffset offset of first '\' in abPath (to skip d:)
+51H 1 bRes unknown
+52H 4 pIFSDrvr points to IFS (Installable File System) driver
+56H 2 wRes unknown
88 size of this structure (DOS 4.0+)
szPath This is an ASCIIZ▲ string giving the entire name of the
current default directory for this logical drive, starting
with the drive ID (e.g., C:\DOS\UTILS◄0►).
On Subst drives, this is the true name of the directory on the
actual drive in which it resides.
rFlags I don't have the layout of these flags but C000H is a network
drive, 5000H is a Subst drive, and 0000H is an invalid drive.
pfDPB Address of the Drive Parameter Block (DPB) for this drive.
wClustNo on non-network drives, this is the cluster number of the first
cluster of the current default directory for this drive.
On network drives, this is the address of a network redirector
wNetUsrCode on network drives, this is the "user code" that was passed in
CX to DOS fn 5f03H (make network connection).
wSlashOffset This is usually 0002H; it is the offset of the first backslash
(\) in the szPath field (you add this to the addr of the start
of the record and viola, you are past the d: drive ID.
pIFSDrvr For drives that are part of an "Installable File System", this
is the address of the IFS driver. Sorry, I have no info on
See Also: fn 52H (get DOS vars address/ListOfLists)
fn 47H (query default directory)
fn 3bH (set default directory -- CHDIR)