Aric Stewart : msctf: Implement ITfCategoryMgr::UnregisterCategory.

Alexandre Julliard julliard at winehq.org
Mon May 4 09:06:39 CDT 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri May  1 10:19:44 2009 -0500

msctf: Implement ITfCategoryMgr::UnregisterCategory.

---

 dlls/msctf/categorymgr.c          |   32 ++++++++++++++++++++++++++++++--
 dlls/msctf/tests/inputprocessor.c |    4 ++--
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/dlls/msctf/categorymgr.c b/dlls/msctf/categorymgr.c
index 648352a..3f47140 100644
--- a/dlls/msctf/categorymgr.c
+++ b/dlls/msctf/categorymgr.c
@@ -144,9 +144,37 @@ static HRESULT WINAPI CategoryMgr_RegisterCategory ( ITfCategoryMgr *iface,
 static HRESULT WINAPI CategoryMgr_UnregisterCategory ( ITfCategoryMgr *iface,
         REFCLSID rclsid, REFGUID rcatid, REFGUID rguid)
 {
+    WCHAR fullkey[110];
+    WCHAR buf[39];
+    WCHAR buf2[39];
+    HKEY tipkey;
     CategoryMgr *This = (CategoryMgr*)iface;
-    FIXME("STUB:(%p)\n",This);
-    return E_NOTIMPL;
+
+    static const WCHAR ctg[] = {'C','a','t','e','g','o','r','y',0};
+    static const WCHAR itm[] = {'I','t','e','m',0};
+    static const WCHAR fmt[] = {'%','s','\\','%','s',0};
+    static const WCHAR fmt2[] = {'%','s','\\','%','s','\\','%','s','\\','%','s',0};
+
+    TRACE("(%p) %s %s %s\n",This,debugstr_guid(rclsid), debugstr_guid(rcatid), debugstr_guid(rguid));
+
+    StringFromGUID2(rclsid, buf, 39);
+    sprintfW(fullkey,fmt,szwSystemTIPKey,buf);
+
+    if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,fullkey, 0, KEY_READ | KEY_WRITE,
+                &tipkey ) != ERROR_SUCCESS)
+        return E_FAIL;
+
+    StringFromGUID2(rcatid, buf, 39);
+    StringFromGUID2(rguid, buf2, 39);
+    sprintfW(fullkey,fmt2,ctg,ctg,buf,buf2);
+
+    sprintfW(fullkey,fmt2,ctg,itm,buf2,buf);
+    RegDeleteTreeW(tipkey, fullkey);
+    sprintfW(fullkey,fmt2,ctg,itm,buf2,buf);
+    RegDeleteTreeW(tipkey, fullkey);
+
+    RegCloseKey(tipkey);
+    return S_OK;
 }
 
 static HRESULT WINAPI CategoryMgr_EnumCategoriesInItem ( ITfCategoryMgr *iface,
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 8173562..be53391 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -177,9 +177,9 @@ static void test_UnregisterCategory(void)
 {
     HRESULT hr;
     hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_TIP_KEYBOARD, &CLSID_FakeService);
-    todo_wine ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
+    ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
     hr = ITfCategoryMgr_UnregisterCategory(g_cm, &CLSID_FakeService, &GUID_TFCAT_DISPLAYATTRIBUTEPROVIDER, &CLSID_FakeService);
-    todo_wine ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
+    ok(SUCCEEDED(hr),"ITfCategoryMgr_UnregisterCategory failed\n");
 }
 
 static void test_FindClosestCategory(void)




More information about the wine-cvs mailing list