From 3194e0556fd1a4c86e12beace738c9a42263e80b Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 26 May 2025 06:40:22 +0900 Subject: [PATCH] [MSCTF] Implement CheckAnchorStore function (#8025) Implementing missing features... JIRA issue: CORE-19361 --- dll/win32/msctf/utils.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dll/win32/msctf/utils.cpp b/dll/win32/msctf/utils.cpp index 394c21b316e..ccecab6f07d 100644 --- a/dll/win32/msctf/utils.cpp +++ b/dll/win32/msctf/utils.cpp @@ -49,6 +49,7 @@ BOOL gfSharedMemory = FALSE; LONG g_cRefDll = -1; BOOL g_fCUAS = FALSE; TCHAR g_szCUASImeFile[16] = { 0 }; +BOOL g_fNoITextStoreAnchor = TRUE; // Messages UINT g_msgPrivate = 0; @@ -481,11 +482,22 @@ BOOL InitLangChangeHotKey(VOID) } /** - * @unimplemented + * @implemented */ VOID CheckAnchorStores(VOID) { - //FIXME + HKEY hKey; + LSTATUS error; + error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\CTF"), 0, KEY_READ, &hKey); + if (error != ERROR_SUCCESS) + return; + + DWORD dwData = 0, cbData = sizeof(dwData); + error = RegQueryValueEx(hKey, TEXT("EnableAnchorContext"), NULL, NULL, (PBYTE)&dwData, &cbData); + if (error == ERROR_SUCCESS && cbData == sizeof(DWORD) && dwData == 1) + g_fNoITextStoreAnchor = FALSE; + + RegCloseKey(hKey); } VOID InitCUASFlag(VOID)