Function Reference


_StreamLockRegion

Restricts access to a specified range of bytes using IStream::LockRegion.

_StreamLockRegion(ByRef $oStream, $iOffset, $iLength, $dwLockType)

Parameters

$oStream IStream COM object.
$iOffset Starting offset of the region to lock.
$iLength Length of the region to lock.
$dwLockType Type of lock (e.g., 0x00000000 for exclusive lock).

Return Value

Success: 1
Failure: 0, sets @error to:
1 - Invalid stream object.
2 - COM error (HRESULT in @extended).

Remarks

Not all stream implementations support locking (e.g., memory streams return STG_E_INVALIDFUNCTION).

Related

_StreamUnlockRegion