File and Record Locking in Windows NT

ID: q102738


The information in this article applies to:
  • Microsoft Windows NT operating system, version 3.1
  • Microsoft Windows NT Advanced Server, version 3.1


SUMMARY

Microsoft Windows NT version 3.1 can support file and record locking using appropriate Win32 application programming interfaces (APIs). File sharing with these capabilities can be achieved via Windows NT server message block (SMB) file sharing protocol extensions.


MORE INFORMATION

File, record, and field locking are essential for applications that require sharing a file by multiple users who may be entering data concurrently. In Windows NT, this may be achieved by using Win32 APIs.

  • LockFile - Locks a region in an open file. Locking a region with this API denies all other processes read and write access to the specified region.


  • LockFileEx - Locks a byte range within an open file for shared or exclusive access. This API allows read access if shared lock is specified but denies write access.


If the specified file is at a remote location, the file and record locking can be handled by one of the SMB.

  • LOCKING_ANDX_SHARED_LOCK - Locks a byte range within the specified file for shared or exclusive access.


Reference(s):

  1. NT LAN Manager SMB File Sharing Protocol Extensions by Chuck Lenzmeir and Manny Weiser.


  2. Microsoft Win32 Programmer's Reference, Volume 4 page 103.


Additional query words: prodnt file locking

Keywords : kbnetwork
Version : 3.1
Platform : WINDOWS
Issue type :


Last Reviewed: August 26, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.