Export (0) Print
Expand All

IStream::UnlockRegion method

The UnlockRegion method removes the access restriction on a range of bytes previously restricted with IStream::LockRegion.

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 to be restricted.

dwLockType [in]

Specifies the access restrictions previously placed on the range.

Return value

This method can return one of these values.

S_OK

The byte range was unlocked.

E_PENDING

Asynchronous Storage only: Part or all of the stream's data is currently unavailable. For more information see IFillLockBytes and Asynchronous Storage.

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 operation cannot be granted.

STG_E_REVERTED

The object has been invalidated by a revert operation above it in the transaction tree.

Remarks

IStream::UnlockRegion unlocks a region previously locked with the IStream::LockRegion method. Locked regions must later be explicitly unlocked by calling IStream::UnlockRegion with exactly the same values for the libOffset, cb, and dwLockType parameters. The region must be unlocked before the stream is released. 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_IStream is defined as 0000000C-0000-0000-C000-000000000046

See also

IStream - Compound File Implementation
LOCKTYPE
IStream::LockRegion

 

 

Community Additions

ADD
Show:
© 2014 Microsoft