ITextStoreAnchorSink::OnLockGranted method (textstor.h)

Called to grant a document lock.

Syntax

HRESULT OnLockGranted(
  [in] DWORD dwLockFlags
);

Parameters

[in] dwLockFlags

Contains a set of flags that identify the type of lock requested and other lock request data. This can be one of the following values.

Value Meaning
TS_LF_READ
The lock is read-only.
TS_LF_READWRITE
The lock is read/write.

Return value

This method can return one of these values.

Value Description
S_OK
The method was successful.
E_INVALIDARG
dwLockFlags is invalid.
E_UNEXPECTED
The wrong type of lock was granted.

Remarks

A document lock is requested by calling ITextStoreAnchor::RequestLock. The application grants the lock request by calling ITextStoreAnchorSink::OnLockGranted with the requested lock type. The lock is only valid during the OnLockGranted call. When OnLockGranted returns, the document is considered unlocked.

The lock type, specified in dwLockFlags, must match the requested lock type in the corresponding call to ITextStoreAnchor::RequestLock.

Calls to ITextStoreAnchor::RequestLock from within OnLockGranted will return an error value.

Applications must not call any of the ITextStoreAnchorSink methods from within the context of OnLockGranted.

If a synchronous lock request is made from within ITextStoreAnchor::RequestLock, then the caller must also provide the return value from ITextStoreAnchor::RequestLock.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header textstor.h
DLL Msctf.dll
Redistributable TSF 1.0 on Windows 2000 Professional

See also

Document Locks

ITextStoreAnchor::RequestLock

ITextStoreAnchorSink

TS_LF_* Constants