Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>function 440eh get logical drive map dos 3.2+</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Function 440Eh          Get Logical Drive Map                        DOS 3.2+

    Determines whether a physical drive has more than one logical
    drive number and returns the active drive number if it does.

        Entry   AX = 440Eh
                BL = Logical drive number (0 = default, 1 = A, etc.)

        Return  AL = 0   Physical drive has only one drive number
                AL > 0   Active drive number for the corresponding
                         physical drive (1 = A, 2 = B, etc.)
                or
                AX = Error code, if CF is set
                     | 01h Invalid function
                     | 05h Access denied
                     | 0Fh Invalid drive

    ------------------------------------------------------------------

    If a program attempts to access the drive by using an inactive
    drive number, DOS prompts the user with the message "Insert
    diskette for drive x: and press any key when ready."

    Function 440Fh can be used to set the active drive number for a
    physical drive that has more than one logical drive number.


    Example

        ; Examine drive A
        mov     bl,1            ; Logical drive number
        mov     ax,4409h        ; Is Drive Remote
        int     21h             ; Returns dx = device attributes
        mov     cx,0000h        ; Assume invalid drive
        jc      done            ; cf = 1 if invalid drive
        mov     cl,bl           ; Assume logical = physical drive
        test    dx,1 shl 12     ; Is drive local?
        jnz     done            ; No, jump
        test    dx,1 shl 6      ; Is function 440eh supported?
        jz      done            ; No, done here
        mov     ax,440eh        ; Yes,
        int     21h             ;   Get Logical Drive Map
        jc      done            ; CF set on error
        mov     ch,al           ; Return current alias drive no. if any
     done:
        jcxz    no_drive        ; cx = 0 if invalid drive
        test    ch,ch           ; ch = 0 if logical = physical drive
        jz      no_alias
     has_alias:                 ; ch = logical drive number currently
        ;...                    ;      used to access drive A (i.e. 2
                                ;      if used as B:)

See Also: 440Fh 4409h Dev17h

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson