Aric Stewart : msctf: Implement ITfKeystrokeMgr::UnpreserveKey.

Alexandre Julliard julliard at winehq.org
Thu May 7 09:25:38 CDT 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Thu May  7 08:31:38 2009 -0500

msctf: Implement ITfKeystrokeMgr::UnpreserveKey.

---

 dlls/msctf/tests/inputprocessor.c |    2 +-
 dlls/msctf/threadmgr.c            |   25 +++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index d29b319..4cc71ef 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -430,7 +430,7 @@ static void test_KeystrokeMgr(void)
     if (hr == S_FALSE) todo_wine ok(preserved == FALSE,"misreporting preserved key\n");
 
     hr = ITfKeystrokeMgr_UnpreserveKey(keymgr, &CLSID_PreservedKey,&tfpk);
-    todo_wine ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey inproperly succeeded\n");
+    ok(hr==CONNECT_E_NOCONNECTION,"ITfKeystrokeMgr_UnpreserveKey inproperly succeeded\n");
 
     hr = ITfKeystrokeMgr_UnadviseKeyEventSink(keymgr,tid);
     todo_wine ok(SUCCEEDED(hr),"ITfKeystrokeMgr_UnadviseKeyEventSink failed\n");
diff --git a/dlls/msctf/threadmgr.c b/dlls/msctf/threadmgr.c
index 5580410..976fcbc 100644
--- a/dlls/msctf/threadmgr.c
+++ b/dlls/msctf/threadmgr.c
@@ -598,8 +598,29 @@ static HRESULT WINAPI KeystrokeMgr_UnpreserveKey(ITfKeystrokeMgr *iface,
         REFGUID rguid, const TF_PRESERVEDKEY *pprekey)
 {
     ThreadMgr *This = impl_from_ITfKeystrokeMgrVtbl(iface);
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+    PreservedKey* key = NULL;
+    struct list *cursor;
+    TRACE("(%p) %s (%x %x)\n",This,debugstr_guid(rguid),(pprekey)?pprekey->uVKey:0, (pprekey)?pprekey->uModifiers:0);
+
+    if (!pprekey || !rguid)
+        return E_INVALIDARG;
+
+    LIST_FOR_EACH(cursor, &This->CurrentPreservedKeys)
+    {
+        key = LIST_ENTRY(cursor,PreservedKey,entry);
+        if (IsEqualGUID(rguid,&key->guid) && pprekey->uVKey == key->prekey.uVKey && pprekey->uModifiers == key->prekey.uModifiers)
+            break;
+        key = NULL;
+    }
+
+    if (!key)
+        return CONNECT_E_NOCONNECTION;
+
+    list_remove(&key->entry);
+    HeapFree(GetProcessHeap(),0,key->description);
+    HeapFree(GetProcessHeap(),0,key);
+
+    return S_OK;
 }
 
 static HRESULT WINAPI KeystrokeMgr_SetPreservedKeyDescription(ITfKeystrokeMgr *iface,




More information about the wine-cvs mailing list