Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ILockBytes::UnlockRegion method

The UnlockRegion method removes the access restriction on a previously locked range of bytes.

Syntax


HRESULT UnlockRegion(
  [in]  ULARGE_INTEGER libOffset,
  [in]  ULARGE_INTEGER cb,
  [in]  DWORD dwLockType
);

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 LOCKTYPE enumeration.

Return value

This method can return one of these 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::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.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Objidl.h

IDL

Objidl.idl

Library

Uuid.lib

DLL

Ole32.dll

IID

IID_ILockBytes is defined as 0000000A-0000-0000-C000-000000000046

See also

ILockBytes::LockRegion
LOCKTYPE
ILockBytes - File-Based Implementation
ILockBytes - Global Memory Implementation

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.