Aric Stewart : msctf: Implement ITfCompartmentMgr::ClearCompartment.

Alexandre Julliard julliard at winehq.org
Wed Jun 17 10:43:23 CDT 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Jun 17 17:01:16 2009 +0900

msctf: Implement ITfCompartmentMgr::ClearCompartment.

---

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

diff --git a/dlls/msctf/compartmentmgr.c b/dlls/msctf/compartmentmgr.c
index ecbe3b1..2e6c798 100644
--- a/dlls/msctf/compartmentmgr.c
+++ b/dlls/msctf/compartmentmgr.c
@@ -33,6 +33,7 @@
 #include "winerror.h"
 #include "objbase.h"
 #include "oleauto.h"
+#include "olectl.h"
 
 #include "wine/unicode.h"
 #include "wine/list.h"
@@ -140,9 +141,25 @@ static HRESULT WINAPI CompartmentMgr_GetCompartment(ITfCompartmentMgr *iface,
 static HRESULT WINAPI CompartmentMgr_ClearCompartment(ITfCompartmentMgr *iface,
     TfClientId tid, REFGUID rguid)
 {
+    struct list *cursor;
     CompartmentMgr *This = (CompartmentMgr *)iface;
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+    TRACE("(%p) %i %s\n",This,tid,debugstr_guid(rguid));
+
+    LIST_FOR_EACH(cursor, &This->values)
+    {
+        CompartmentValue* value = LIST_ENTRY(cursor,CompartmentValue,entry);
+        if (IsEqualGUID(rguid,&value->guid))
+        {
+            if (value->owner && tid != value->owner)
+                return E_UNEXPECTED;
+            list_remove(cursor);
+            ITfCompartment_Release(value->compartment);
+            HeapFree(GetProcessHeap(),0,value);
+            return S_OK;
+        }
+    }
+
+    return CONNECT_E_NOCONNECTION;
 }
 
 static HRESULT WINAPI CompartmentMgr_EnumCompartments(ITfCompartmentMgr *iface,




More information about the wine-cvs mailing list