[MSCTF] Implement InitCUASFlag (#6235)

Implementing TIPs and Language Bar...
JIRA issue: CORE-19361
- Add InitCUASFlag function.
- Use it in ProcessAttach function.
This commit is contained in:
Katayama Hirofumi MZ 2023-12-27 12:32:01 +09:00 committed by GitHub
parent ec0695c26b
commit cfff2dbd12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,6 +45,8 @@ HKL g_hklDefault = NULL;
DWORD g_dwTLSIndex = (DWORD)-1;
BOOL gfSharedMemory = FALSE;
LONG g_cRefDll = -1;
BOOL g_fCUAS = FALSE;
TCHAR g_szCUASImeFile[16] = { 0 };
// Messages
UINT g_msgPrivate = 0;
@ -484,6 +486,40 @@ VOID CheckAnchorStores(VOID)
//FIXME
}
VOID InitCUASFlag(VOID)
{
CicRegKey regKey1;
LSTATUS error;
error = regKey1.Open(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\CTF\\SystemShared\\"));
if (error == ERROR_SUCCESS)
{
DWORD dwValue;
error = regKey1.QueryDword(TEXT("CUAS"), &dwValue);
if (error == ERROR_SUCCESS)
g_fCUAS = !!dwValue;
}
g_szCUASImeFile[0] = TEXT('\0');
if (!g_fCUAS)
return;
TCHAR szImeFile[16];
CicRegKey regKey2;
error = regKey2.Open(HKEY_LOCAL_MACHINE,
TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\IMM"));
if (error == ERROR_SUCCESS)
{
error = regKey2.QuerySz(TEXT("IME File"), szImeFile, _countof(szImeFile));
if (error == ERROR_SUCCESS)
{
g_szCUASImeFile[_countof(g_szCUASImeFile) - 1] = TEXT('\0'); // Avoid buffer overrun
StringCchCopy(g_szCUASImeFile, _countof(g_szCUASImeFile), szImeFile);
}
}
}
/**
* @unimplemented
*/
@ -541,6 +577,10 @@ BOOL ProcessAttach(HINSTANCE hinstDLL) // FIXME: Call me from DllMain
//FIXME
InitCUASFlag();
//FIXME
GetDesktopUniqueName(TEXT("CTF.AsmListCache.FMP"), g_szAsmListCache, _countof(g_szAsmListCache));
GetDesktopUniqueName(TEXT("CTF.TimListCache.FMP"), g_szTimListCache, _countof(g_szTimListCache));
GetDesktopUniqueName(TEXT("CTF.LayoutsCache.FMP"), g_szLayoutsCache, _countof(g_szLayoutsCache));