https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8f0e22ac23b06a5193b12…
commit 8f0e22ac23b06a5193b12048d799749975733f5c
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Oct 21 10:11:59 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Fri Oct 21 10:11:59 2022 +0900
[IMM32] Simplify Imm32WriteImeLayout
CORE-11700
---
dll/win32/imm32/precomp.h | 2 +-
dll/win32/imm32/utils.c | 13 ++++++-------
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/dll/win32/imm32/precomp.h b/dll/win32/imm32/precomp.h
index ca8da55a108..5e1138482cc 100644
--- a/dll/win32/imm32/precomp.h
+++ b/dll/win32/imm32/precomp.h
@@ -153,7 +153,7 @@ HRESULT APIENTRY Imm32StrToUInt(LPCWSTR pszText, LPDWORD pdwValue,
ULONG nBase);
HRESULT APIENTRY Imm32UIntToStr(DWORD dwValue, ULONG nBase, LPWSTR pszBuff, USHORT
cchBuff);
BOOL APIENTRY Imm32LoadImeVerInfo(PIMEINFOEX pImeInfoEx);
UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts);
-BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout);
+BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayoutText);
HKL APIENTRY Imm32AssignNewLayout(UINT cKLs, const REG_IME *pLayouts, WORD wLangID);
BOOL APIENTRY Imm32CopyImeFile(LPWSTR pszOldFile, LPCWSTR pszNewFile);
diff --git a/dll/win32/imm32/utils.c b/dll/win32/imm32/utils.c
index d2271fbabe0..1bcbb20823f 100644
--- a/dll/win32/imm32/utils.c
+++ b/dll/win32/imm32/utils.c
@@ -933,11 +933,11 @@ UINT APIENTRY Imm32GetImeLayout(PREG_IME pLayouts, UINT cLayouts)
}
// Win: WriteImeLayout
-BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayout)
+BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart, LPCWSTR pszLayoutText)
{
UINT iPreload;
HKEY hkeyLayouts, hkeyIME, hkeyPreload;
- WCHAR szImeKey[20], szPreloadNumber[20], szPreloadKey[20], szImeFileName[80];
+ WCHAR szImeKey[20], szPreloadNumber[20], szPreloadKey[20];
DWORD cbData;
LANGID LangID;
LONG lError;
@@ -963,8 +963,8 @@ BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart,
LPCWSTR pszLayou
goto Failure;
/* Write "Layout Text" */
- cbData = (wcslen(pszLayout) + 1) * sizeof(WCHAR);
- lError = RegSetValueExW(hkeyIME, L"Layout Text", 0, REG_SZ,
(LPBYTE)pszLayout, cbData);
+ cbData = (wcslen(pszLayoutText) + 1) * sizeof(WCHAR);
+ lError = RegSetValueExW(hkeyIME, L"Layout Text", 0, REG_SZ,
(LPBYTE)pszLayoutText, cbData);
if (lError != ERROR_SUCCESS)
goto Failure;
@@ -976,11 +976,10 @@ BOOL APIENTRY Imm32WriteImeLayout(HKL hKL, LPCWSTR pchFilePart,
LPCWSTR pszLayou
case LANG_KOREAN: pszLayoutFile = L"kbdkor.dll"; break;
default: pszLayoutFile = L"kbdus.dll"; break;
}
- StringCchCopyW(szImeFileName, _countof(szImeFileName), pszLayoutFile);
/* Write "Layout File" */
- cbData = (wcslen(szImeFileName) + 1) * sizeof(WCHAR);
- lError = RegSetValueExW(hkeyIME, L"Layout File", 0, REG_SZ,
(LPBYTE)szImeFileName, cbData);
+ cbData = (wcslen(pszLayoutFile) + 1) * sizeof(WCHAR);
+ lError = RegSetValueExW(hkeyIME, L"Layout File", 0, REG_SZ,
(LPBYTE)pszLayoutFile, cbData);
if (lError != ERROR_SUCCESS)
goto Failure;