다음을 통해 공유


MyFSD_UnLockFileEx (Windows CE 5.0)

Send Feedback

This function unlocks a region in an open file. Unlocking a region enables other processes to access the region.

BOOL MyFSD_UnlockFileEx(  DWORD dwFile,
  DWORDdwReserved,
  DWORDnNumberOfBytesToUnlockLow,
  DWORDnNumberOfBytesToUnlockHigh,
  LPOVERLAPPEDlpOverlapped
);

Parameters

  • dwFile
    [in] Pointer to the value that an FSD passes to the FSDMGR_CreateFileHandle function when creating the file handle.
  • dwReserved
    Ignored, set to zero
  • nNumberOfBytesToUnlockLow
    [in] Low-order portion of the length of the byte range to unlock.
  • nNumberOfBytesToUnlockHigh
    [in] High-order portion of the length of the byte range to unlock.
  • lpOverlapped
    [in] Pointer to an OVERLAPPED structure that is used with the unlock request. This structure contains the file offset of the beginning of the unlock range.

Return Values

Nonzero indicates that the lock was successfully removed. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

All FSD functions can be called re-entry; therefore, FSD developers must take this into account when developing an FSD.

Though the function requires an OVERLAPPED structure, it does not support asynchronous locking. In Windows CE, the OVERLAPPED structure is used only to describe the byte range to be locked. Fields other than OffsetHigh and Offset within the OVERLAPPED structure should be ignored.

FSDMGR provides the lock helper function FSDMGR_RemoveFileLock to simplify implementation of this function in an FSD.

The following example shows a simple implementation.

BOOL MyFSD_UnlockFileEx (
    PFILE pFile, 
    DWORD dwReserved, 
    DWORD nNumberOfBytesToLockLow, 
    DWORD nNumberOfBytesToLockHigh, 
    LPOVERLAPPED lpOverlapped
    )
{
    return FSDMGR_RemoveFileLock (
    MyAcquireFileLockState, 
    MyReleaseFileLockState, 
    (DWORD)pFile, 
    dwReserved, 
    nNumberOfBytesToLockLow, 
    nNumberOfBytesToLockHigh, 
    lpOverlapped
);
}

The Fsdmgr component is a DLL that manages all operating system (OS) interaction with installable files systems. Each installable file system requires an FSD, which is a DLL that exports an interface that is needed to support an installable file system. The name of the DLL for the FSD and the names of the functions it exports start with the name of the associated installable file system. For example, if the name of file system is MyFSD, then its DLL is MyFSD.dll and its exported functions are prefaced with MyFSD_*.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Fsdmgr.h.
Link Library: Fsdmgr.lib.

See Also

CreateDirectory | CloseHandle | FSDMGR_CreateFileHandle | FSDMGR_RegisterVolume | MyFSD_CreateDirectoryW | MyFSD_CreateFileW | MyFSD_DeleteFileW | MyFSD_FindClose | MyFSD_FindFirstFileW

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.