ILockBytes::UnlockRegion  1WR5TUI

Removes the access restriction on a previously locked range of bytes.

HRESULT UnlockRegion(

    ULARGE_INTEGER libOffset,

//Specifies the byte offset for the beginning of the range

    ULARGE_INTEGER cb,

//Specifies the length of the range in bytes

    DWORD dwLockType

//Specifies the access restriction previously placed on the range

   );

 

 

Parameters

libOffset

[in]Specifies the byte offset for the beginning of the range.

cb

[in]Specifies, in bytes, the length of the range that is restricted.

dwLockType

[in]Specifies the type of access restrictions previously placed on the range. This parameter uses a value from the LOCKTYPER03AHX enumeration.

 

Return Values

S_OK

The byte range was unlocked.

STG_E_INVALIDFUNCTION

Locking is not supported at all or the specific type of lock requested is not supported.

STG_E_LOCKVIOLATION

The requested unlock cannot be granted.

 

Remarks

ILockBytes::UnlockRegion unlocks a region previously locked with a call to ILockBytes::LockRegionEQARJ1. Each region locked must be explicitly unlocked, using the same values for the libOffset, cb, and dwLockType parameters as in the matching calls to ILockBytes::LockRegion. Two adjacent regions cannot be locked separately and then unlocked with a single unlock call.

See Also

ILockBytes::LockRegionEQARJ1, LOCKTYPER03AHX, ILockBytes File-Based Implementation3Z4N_X8, ILockBytes Global Memory ImplementationC4TW_0