Commit bdb54fda authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

msctf: Generate TfEditCookies for edit sessions.

parent a5006e7e
......@@ -668,6 +668,8 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
{
TextStoreACPSink *This = (TextStoreACPSink *)iface;
HRESULT hr;
EditCookie *cookie;
TfEditCookie ec;
TRACE("(%p) %x\n",This, dwLockFlags);
......@@ -677,12 +679,23 @@ static HRESULT WINAPI TextStoreACPSink_OnLockGranted(ITextStoreACPSink *iface,
return E_FAIL;
}
/* TODO: generate and use an edit cookie */
hr = ITfEditSession_DoEditSession(This->pContext->currentEditSession, 0xdeadcafe);
cookie = HeapAlloc(GetProcessHeap(),0,sizeof(EditCookie));
if (!cookie)
return E_OUTOFMEMORY;
cookie->lockType = dwLockFlags;
cookie->pOwningContext = This->pContext;
ec = generate_Cookie(COOKIE_MAGIC_EDITCOOKIE, cookie);
hr = ITfEditSession_DoEditSession(This->pContext->currentEditSession, ec);
ITfEditSession_Release(This->pContext->currentEditSession);
This->pContext->currentEditSession = NULL;
/* Edit Cookie is only valid during the edit session */
cookie = remove_Cookie(ec);
HeapFree(GetProcessHeap(),0,cookie);
return hr;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment