This method of the ILockBytes interface restricts access to a specified range of bytes in the byte array.
public void LockRegion(long libOffset, long cb, int dwLockType);
S_OK -- the specified range of bytes was locked.
STG_E_INVALIDFUNCTION -- locking is not supported at all or the specific type of lock requested is not supported.
STG_E_ACCESSDENIED -- access denied because the caller has insufficient permission, or another caller has the file open and locked.
STG_E_LOCKVIOLATION -- access denied because another caller has the file open and locked.
STG_E_INVALIDHANDLE -- an underlying file has been prematurely closed, or the correct disk has been replaced by an invalid one.
[in] libOffset | Specifies the byte offset for the beginning of the range. |
[in] cb | Specifies, in bytes, the length of the range to be restricted. |
[in] dwLockType | Specifies the type of restrictions being requested on accessing the range. |