This call performs multiple locking, unlocking, seeking, and I/O operations
on an
opened file.
DosFileIO
FileHandle (HFILE) - input
CmdLock
Cmd (USHORT) - input
Value
Because the lock operation is atomic, if a lock within a CmdLock causes a time out, none of the other locks within the scope of CmdLock are in force.
Share (USHORT) - input
Value
Cmd (USHORT) - input
Start (ULONG) - input
Cmd (USHORT) - input
Value
Cmd (USHORT) - input
Value
DosFileIO combines the following operations into a single request:
o
The ability to combine operations on files provides improved performance and makes DosFileIO particularly suited to a networking environment.
Unlike DosFileLocks, which unconditionally prevents access to only one range in a file at a time, DosFileIO permits multiple regions to be locked. DosFileIO also offers the option of read-only access to locked regions by the current process and any sharing processes.
If another process attempts to read or write in a "No-access" region, or if any process attempts to write in a "Read-only" region, ERROR_ACCESS_DENIED is returned.
A range to be locked must first be cleared of any locked subranges or overlapping ranges. If a time out occurs before locking can be completed, DosFileIO returns with an unsuccessful return code. The caller may return after the time-out period has expired without receiving an ERROR_SEM_TIMEOUT. Therefore, semaphore time-out values should not be used for exact timing and sequencing.