Partager via


FSDMGR_InstallFileLock

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function is the Lock Manager implementation of LockFileEx.

Syntax

BOOL
FSDMGR_InstallFileLock(
    PACQUIREFILELOCKSTATE pAcquireFileLockState,
    PRELEASEFILELOCKSTATE pReleaseFileLockState,
    DWORD dwHandle,
    DWORD dwFlags,
    DWORD dwReserved,
    DWORD nNumberOfBytesToLockLow,
    DWORD nNumberOfBytesToLockHigh,
    LPOVERLAPPED lpOverlapped
    );

Parameters

  • pAcquireFileLockState
    Pointer to a PACQUIREFILELOCKSTATE function in the calling file system driver (FSD).
  • dwHandle
    Pointer to the value that an FSD passes to the FSDMGR_CreateFileHandle function when creating the file handle.
  • dwFlags
    Flag value. The following table shows possible values.

    Value Description

    LOCKFILE_EXCLUSIVE_LOCK

    This function requests an exclusive lock. If this flag is not specified, the function requests a shared lock.

    LOCKFILE_FAIL_IMMEDIATELY

    This function returns immediately if it is unable to acquire the requested lock. If this flag is not specified, the function waits.

  • dwReserved
    Reserved. Set to zero.
  • nNumberOfBytesToLockLow
    Low-order 32 bits of the length of the byte range to lock.
  • nNumberOfBytesToLockHigh
    High-order 32 bits of the length of the byte range to lock.
  • lpOverlapped
    Pointer to an OVERLAPPED structure that is used with the lock request. This structure contains the file offset of the beginning of the unlock range.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Requirements

Header lockmgr.h
Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Windows Mobile 6 and later

See Also

Reference

FSDMGR Functions