Aric Stewart : msctf: Implement ITfCompartmentMgr::GetCompartment.

Alexandre Julliard julliard at winehq.org
Mon Jun 22 09:04:17 CDT 2009


Module: wine
Branch: master
Commit: ba69aebd3eb2b5b4063dcf9a377147cc25dec35a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ba69aebd3eb2b5b4063dcf9a377147cc25dec35a

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Jun 22 12:02:49 2009 +0900

msctf: Implement ITfCompartmentMgr::GetCompartment.

---

 dlls/msctf/compartmentmgr.c |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/dlls/msctf/compartmentmgr.c b/dlls/msctf/compartmentmgr.c
index 09b71b1..5379495 100644
--- a/dlls/msctf/compartmentmgr.c
+++ b/dlls/msctf/compartmentmgr.c
@@ -153,8 +153,39 @@ static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
         REFGUID rguid, ITfCompartment **ppcomp)
 {
     CompartmentMgr *This = (CompartmentMgr *)iface;
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+    CompartmentValue* value;
+    struct list *cursor;
+    HRESULT hr;
+
+    TRACE("(%p) %s  %p\n",This,debugstr_guid(rguid),ppcomp);
+
+    LIST_FOR_EACH(cursor, &This->values)
+    {
+        value = LIST_ENTRY(cursor,CompartmentValue,entry);
+        if (IsEqualGUID(rguid,&value->guid))
+        {
+            ITfCompartment_AddRef(value->compartment);
+            *ppcomp = value->compartment;
+            return S_OK;
+        }
+    }
+
+    value = HeapAlloc(GetProcessHeap(),0,sizeof(CompartmentValue));
+    value->guid = *rguid;
+    value->owner = 0;
+    hr = Compartment_Constructor(value,&value->compartment);
+    if (SUCCEEDED(hr))
+    {
+        list_add_head(&This->values,&value->entry);
+        ITfCompartment_AddRef(value->compartment);
+        *ppcomp = value->compartment;
+    }
+    else
+    {
+        HeapFree(GetProcessHeap(),0,value);
+        *ppcomp = NULL;
+    }
+    return hr;
 }
 
 static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,




More information about the wine-cvs mailing list