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► ◄Notes► ◄Back►
──────────────────────────────────────────────────────────────────────────────
▀ This function is useful for file and record synchronization in a multi-
tasking environment or network. Access to the file as a whole is control-
led 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 sup-
plied as a positive double-precision integer.
▀ For every call to lock a region of a file, there must be a subsequent un-
lock 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 re-
sult is undefined. Therefore, programs using this function should install
their own Int 23H and Int 24H handlers so the processes cannot be termin-
ated 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.
-♦-