Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Ralf Brown's Interrupt List (Part 1,2) - int 21 - dos 2+ - open disk file with handle http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
INT 21 - DOS 2+ - OPEN DISK FILE WITH HANDLE
        AH = 3Dh
        AL = access mode
            00h read only
            01h write only
            02h read/write
        AL bits 7-3 = file-sharing modes (DOS 3+)
            bit 7    = inheritance flag, set for no inheritance
            bits 4-6 = sharing mode
                      000 compatibility mode
                      001 exclusive (deny all)
                      010 write access denied (deny write)
                      011 read access denied (deny read)
                      100 full access permitted (deny none)
                      111 used internally by SHARE
            bit 3    = reserved, should be zero
        DS:DX -> ASCIZ filename
Return: CF set on error
            AX = error code (01h,02h,03h,04h,05h,0Ch) (see AH=59h)
        CF clear if successful
            AX = file handle
Notes:  file pointer is set to start of file
        file handles which are inherited from a parent also inherit sharing
          and access restrictions
SeeAlso: AH=0Fh,AH=3Ch,INT 2F/AX=1226h

File sharing behavior:
          |     Second and subsequent Opens
 First    |Compat  Deny   Deny   Deny   Deny
 Open     |        All    Write  Read   None
          |R W RW R W RW R W RW R W RW R W RW
 - - - - -| - - - - - - - - - - - - - - - - -
 Compat R |Y Y Y  N N N  1 N N  N N N  1 N N
        W |Y Y Y  N N N  N N N  N N N  N N N
        RW|Y Y Y  N N N  N N N  N N N  N N N
 - - - - -|
 Deny   R |C C C  N N N  N N N  N N N  N N N
 All    W |C C C  N N N  N N N  N N N  N N N
        RW|C C C  N N N  N N N  N N N  N N N
 - - - - -|
 Deny   R |2 C C  N N N  Y N N  N N N  Y N N
 Write  W |C C C  N N N  N N N  Y N N  Y N N
        RW|C C C  N N N  N N N  N N N  Y N N
 - - - - -|
 Deny   R |C C C  N N N  N Y N  N N N  N Y N
 Read   W |C C C  N N N  N N N  N Y N  N Y N
        RW|C C C  N N N  N N N  N N N  N Y N
 - - - - -|
 Deny   R |2 C C  N N N  Y Y Y  N N N  Y Y Y
 None   W |C C C  N N N  N N N  Y Y Y  Y Y Y
        RW|C C C  N N N  N N N  N N N  Y Y Y
Legend: Y = open succeeds, N = open fails with error code 05h
        C = open fails, INT 24 generated
        1 = open succeeds if file read-only, else fails with error code
        2 = open succeeds if file read-only, else fails with INT 24

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