IOpLockStatus::IsOplockValid Method

Checks the status of the opportunistic lock (OpLock) on the item being indexed.

Syntax

HRESULT IsOplockValid(      
    BOOL *pfIsOplockValid
);

Parameters

  • pfIsOplockValid
    [out] Returns a pointer to a BOOL value that indicates whether the OpLock is successfully taken.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

An oplock is an opportunistic lock that allows the indexer to lock the item when nanother process isn't accessing it. The indexer releases the item, invalidating or breaking the lock, when another process requests an incompatible access mode. This allows the indexer to run in the background and not impede other processes access to these items.

An oplock is never taken after the underlying IUrlAccessor object is initialized, and any call to this method yields the same output value on the same object.