网站首页  词典首页

请输入您要查询的函数:

 

术语 unlockfile
释义 UnlockFile
语法:
C++
BOOL WINAPI UnlockFile(
__in HANDLE hFile,
__in DWORD dwFileOffsetLow,
__in DWORD dwFileOffsetHigh,
__in DWORD nNumberOfBytesToUnlockLow,
__in DWORD nNumberOfBytesToUnlockHigh
);
UnlockFile功能
解锁在一个打开的文件的地区。解锁一个区域,使其他进程访问该地区。
对于一个替代方法来指定区域,使用UnlockFileEx功能。
参数
hFile [in]
一个句柄,文件包含取决于LockFile锁定的地区。文件句柄必须已创建无论是GENERIC_READ或GENERIC_WRITE访问权限。有关更多信息,请参阅文件安全性和访问权限。
dwFileOffsetLow [in]
低在文件的起始偏移字节顺序单词锁定区域地方开始。
dwFileOffsetHigh [in]
高在文件的起始偏移字节顺序单词锁定区域地方开始。
nNumberOfBytesToUnlockLow [in]
的低字节的范围长度为单词被锁定。
nNumberOfBytesToUnlockHigh [in]
的高字节的范围长度为单词被锁定。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
这个函数总是同步运行,但可能不是一个完成进入队列时,与完成端口关联的文件句柄。
解锁一个文件的一个地区发行的文件先前获得的锁。该地区解锁必须完全一致,因此现有的锁定区域。一个文件的两个邻近地区无法锁定,然后锁定单独使用一个地区横跨内陆地区。
如果一个进程终止同一个锁定文件的一部分或关闭的文件具有杰出的锁,锁锁定由操作系统。然而,所需的时间,操作系统,以解开这些锁需取决于可用的系统资源。因此,建议您的进程明确解锁所有已锁定的文件时终止。如果不这样做,访问这些文件可能会被拒绝如果操作系统还没有锁定他们。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinBase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateFile
文件管理函数
取决于LockFile
UnlockFileEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年9月3日
==英文原文==UnlockFile Function
Unlocks a region in an open file. Unlocking a region enables other processes to access the region.
For an alternate way to specify the region, use the UnlockFileEx function.
Syntax
C++
BOOL WINAPI UnlockFile(
__in HANDLE hFile,
__in DWORD dwFileOffsetLow,
__in DWORD dwFileOffsetHigh,
__in DWORD nNumberOfBytesToUnlockLow,
__in DWORD nNumberOfBytesToUnlockHigh
);
Parameters
hFile [in]
A handle to the file that contains a region locked with LockFile . The file handle must have been created with either the GENERIC_READ or GENERIC_WRITE access right. For more information, see File Security and Access Rights .
dwFileOffsetLow [in]
The low-order word of the starting byte offset in the file where the locked region begins.
dwFileOffsetHigh [in]
The high-order word of the starting byte offset in the file where the locked region begins.
nNumberOfBytesToUnlockLow [in]
The low-order word of the length of the byte range to be unlocked.
nNumberOfBytesToUnlockHigh [in]
The high-order word of the length of the byte range to be unlocked.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
This function always operates synchronously, but may not queue a completion entry when a completion port is associated with the file handle.
Unlocking a region of a file releases a previously acquired lock on the file. The region to unlock must correspond exactly to an existing locked region. Two adjacent regions of a file cannot be locked separately and then unlocked using a single region that spans both locked regions.
If a process terminates with a portion of a file locked or closes a file that has outstanding locks, the locks are unlocked by the operating system. However, the time it takes for the operating system to unlock these locks depends upon available system resources. Therefore, it is recommended that your process explicitly unlock all files it has locked when it terminates. If this is not done, access to these files may be denied if the operating system has not yet unlocked them.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinBase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateFile
File Management Functions
LockFile
UnlockFileEx
Send comments about this topic to Microsoft
Build date: 9/3/2009
==原始网址==http://msdn.microsoft.com/en-us/library/aa365715(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:26:31