UnlockFileEx

UnlockFileEx

VB声明

Declare Function UnlockFileEx Lib "kernel32" Alias "UnlockFileEx" (ByVal hFile As Long, ByVal dwReserved As Long, ByVal nNumberOfBytesToUnlockLow As Long, ByVal nNumberOfBytesToUnlockHigh As Long, lpOverlapped As OVERLAPPED) As Long

说明

解除对一个文件的锁定

返回值

Long,非零表示成功,零表示失败。会设置GetLastError

参数表

参数

类型及说明

hFile

Long,要解锁的文件的句柄

dwReserved

Long,未用;设为零

nNumberOfBytesToUnlockLow

Long,锁定区域中字符数量的低32位值

nNumberOfBytesToUnlockHigh

Long,锁定区域中字符数量的高32位值

lpOverlapped

OVERLAPPED,包含了文件中相对于解锁区域起始处的偏移量

注解

解锁的文件区域必须与以前锁定时设置的区域完全相符。文件关闭前,应用程序应确定已解除了对任何区域的锁定。参考LockFileEx了解进一步的情况

Top