IFSMgr_LockFile(
void ** ppFSDLockListHead,
unsigned long LockOffset,
unsigned long LockLength,
unsigned long LockOwner,
void * pOpenFileInstance,
unsigned long fLockSemantics
)
This service locks a region of an open file. This service supports two kinds of locking semantics: DOS and Netware. DOS semantics do not allow overlapping locks and a lock prevents any access to that region of the file by another process. On the other hand, Netware's locking semantics provides for overlapping read locks and non-overlapping write locks. It also has the concept of lock promotion of a read lock to a write lock and vice versa. For more details on the Netware locking semantics, please refer to the appropriate Netware documentation.
Lock Semantics Flags: | |
Value | Meaning |
---|---|
LOCKF_DOS | Indicates that DOS semantics are to be applied for the lock request. |
LOCKF_NW | Indicate that Netware semantics are to be applied for the lock request. |
LOCKF_RD | Indicates that a read lock should be taken. This value is allowed only with LOCKF_NW. DOS semantics do not have the concept of a read lock. |
LOCKF_WR | Indicates that a write lock should be taken. |
ppFSDLockListHead | The pointer to the lock list is stored in this variable on a successful return. |
The IFS manager maintains a list of active locks on the file. The head of this list is stored in the variable pointed to by ppFSDLockListHead. The FSD should not attempt to interpret this list in any fashion, it is only for use by the IFS manager. Typically, the head for the list of locks would be a part of the open file information structure and would be maintained on a per-open-file basis. All locks on this open file are part of this list, irrespective of which process and which open file instance they belong to.
When you create a new file, make sure that the pointer pointed to by ppFSDLockListHead is initialized to NULL. Then, do not make any changes to this pointer; *ppFSDLockListHead is a "cookie" that is automatically maintained by IFS Manager.