Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Int 21h Function 5Ch
 Summary                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     This function is useful for file and record synchronization in a
     multitasking environment or network. Access to the file as a whole
     is controlled by the attribute and file-sharing parameters passed
     in open or create calls, and by the file's attributes, which are
     stored in its directory entry.
 
     The beginning location in the file to be locked or unlocked is
     supplied as a positive double-precision integer, which is a byte
     offset into the file. The length of the region to be locked or
     unlocked is similarly supplied as a positive double-precision
     integer.
 
     For every call to lock a region of a file, there must be a
     subsequent unlock call with exactly the same file offset and
     length.
 
     Locking beyond the current end-of-file is not an error.
 
     If a process terminates without releasing active locks on a file,
     the result is undefined. Therefore, programs using this function
     should install their own Int 23h and Int 24h handlers so the
     processes cannot be terminated unexpectedly.
 
     Programs that are loaded with the EXEC call (Int 21h Function 4Bh)
     inherit the handles of their parent but not any active locks.
 
     Duplicate handles created with Int 21h Function 45h, or handles
     redirected to the file with Int 21h Function 46h, are allowed
     access to locked regions within the same process.
                                    -♦-