Locks the specified file for exclusive access by the calling process.
To specify additional options, for example creating a shared lock or for block-on-fail operation, use the LockFileEx function.
Syntax
C++
BOOL WINAPI LockFile(
_In_ HANDLE hFile,
_In_ DWORD dwFileOffsetLow,
_In_ DWORD dwFileOffsetHigh,
_In_ DWORD nNumberOfBytesToLockLow,
_In_ DWORD nNumberOfBytesToLockHigh
);