msctf: Implement ITfContext::GetDocumentMgr.
diff --git a/dlls/msctf/context.c b/dlls/msctf/context.c
index 2c7acb0..5eaffcf 100644
--- a/dlls/msctf/context.c
+++ b/dlls/msctf/context.c
@@ -74,6 +74,7 @@
TfClientId tidOwner;
TfEditCookie defaultCookie;
TS_STATUS documentStatus;
+ ITfDocumentMgr *manager;
ITextStoreACP *pITextStoreACP;
ITfContextOwnerCompositionSink *pITfContextOwnerCompositionSink;
@@ -506,8 +507,15 @@
ITfDocumentMgr **ppDm)
{
Context *This = (Context *)iface;
- FIXME("STUB:(%p)\n",This);
- return E_NOTIMPL;
+ TRACE("(%p) %p\n",This,ppDm);
+
+ if (!ppDm)
+ return E_INVALIDARG;
+
+ *ppDm = This->manager;
+ if (!This->manager)
+ return S_FALSE;
+ return S_OK;
}
static HRESULT WINAPI Context_CreateRangeBackup (ITfContext *iface,
@@ -758,7 +766,7 @@
return S_OK;
}
-HRESULT Context_Initialize(ITfContext *iface)
+HRESULT Context_Initialize(ITfContext *iface, ITfDocumentMgr *manager)
{
Context *This = (Context *)iface;
@@ -769,6 +777,7 @@
(IUnknown*)This->pITextStoreACPSink, TS_AS_ALL_SINKS);
}
This->connected = TRUE;
+ This->manager = manager;
return S_OK;
}
@@ -783,6 +792,7 @@
This->pITextStoreACPSink = NULL;
}
This->connected = FALSE;
+ This->manager = NULL;
return S_OK;
}
diff --git a/dlls/msctf/documentmgr.c b/dlls/msctf/documentmgr.c
index 3d4dbe9..09cadb6 100644
--- a/dlls/msctf/documentmgr.c
+++ b/dlls/msctf/documentmgr.c
@@ -146,7 +146,7 @@
This->contextStack[0] = check;
ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
- Context_Initialize(check);
+ Context_Initialize(check, iface);
return S_OK;
}
diff --git a/dlls/msctf/msctf_internal.h b/dlls/msctf/msctf_internal.h
index 8e093eb..3b959be 100644
--- a/dlls/msctf/msctf_internal.h
+++ b/dlls/msctf/msctf_internal.h
@@ -40,7 +40,7 @@
extern HRESULT CompartmentMgr_Constructor(IUnknown *pUnkOuter, REFIID riid, IUnknown **ppOut);
extern HRESULT CompartmentMgr_Destructor(ITfCompartmentMgr *This);
-extern HRESULT Context_Initialize(ITfContext *cxt);
+extern HRESULT Context_Initialize(ITfContext *cxt, ITfDocumentMgr *manager);
extern HRESULT Context_Uninitialize(ITfContext *cxt);
extern HRESULT TF_SELECTION_to_TS_SELECTION_ACP(const TF_SELECTION *tf, TS_SELECTION_ACP *tsAcp);