Share via


ILockBytes::UnlockRegion (Windows Embedded CE 6.0)

1/6/2010

This method removes the access restriction on a range of bytes previously restricted with the ILockBytes::LockRegion method.

Syntax

HRESULT UnlockRegion( 
  ULARGE_INTEGER libOffset, 
  ULARGE_INTEGER cb, 
  DWORD dwLockType 
);

Parameters

  • libOffset
    [in] Byte offset for the beginning of the range.
  • cb
    [in] Length, in bytes,of the range that is restricted.
  • dwLockType
    [in] Type of access restrictions previously placed on the range.

    This parameter uses a value from the LOCKTYPE enumeration.

Return Value

The following table shows the return values for this method.

Value Description

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::LockRegion.

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.

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 2.0 and later

See Also

Reference

ILockBytes