mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[IMM32] Rewrite ImmInstallIMEA (#3873)
Implementing Japanese input... CORE-11700
This commit is contained in:
parent
bd6fb80867
commit
7507a8f192
1 changed files with 23 additions and 11 deletions
|
@ -2808,21 +2808,33 @@ UINT WINAPI ImmGetVirtualKey(HWND hWnd)
|
||||||
HKL WINAPI ImmInstallIMEA(
|
HKL WINAPI ImmInstallIMEA(
|
||||||
LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
|
LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText)
|
||||||
{
|
{
|
||||||
LPWSTR lpszwIMEFileName;
|
INT cchFileName, cchLayoutText;
|
||||||
LPWSTR lpszwLayoutText;
|
LPWSTR pszFileNameW, pszLayoutTextW;
|
||||||
HKL hkl;
|
HKL hKL;
|
||||||
|
|
||||||
TRACE ("(%s, %s)\n", debugstr_a(lpszIMEFileName),
|
TRACE("(%s, %s)\n", debugstr_a(lpszIMEFileName), debugstr_a(lpszLayoutText));
|
||||||
debugstr_a(lpszLayoutText));
|
|
||||||
|
|
||||||
lpszwIMEFileName = strdupAtoW(lpszIMEFileName);
|
cchFileName = lstrlenA(lpszIMEFileName) + 1;
|
||||||
lpszwLayoutText = strdupAtoW(lpszLayoutText);
|
cchLayoutText = lstrlenA(lpszLayoutText) + 1;
|
||||||
|
|
||||||
hkl = ImmInstallIMEW(lpszwIMEFileName, lpszwLayoutText);
|
pszFileNameW = Imm32HeapAlloc(0, cchFileName * sizeof(WCHAR));
|
||||||
|
if (pszFileNameW == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(),0,lpszwIMEFileName);
|
pszLayoutTextW = Imm32HeapAlloc(0, cchLayoutText * sizeof(WCHAR));
|
||||||
HeapFree(GetProcessHeap(),0,lpszwLayoutText);
|
if (pszLayoutTextW == NULL)
|
||||||
return hkl;
|
{
|
||||||
|
HeapFree(g_hImm32Heap, 0, pszFileNameW);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, lpszIMEFileName, -1, pszFileNameW, cchFileName);
|
||||||
|
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, lpszLayoutText, -1, pszLayoutTextW, cchLayoutText);
|
||||||
|
|
||||||
|
hKL = ImmInstallIMEW(pszFileNameW, pszLayoutTextW);
|
||||||
|
HeapFree(g_hImm32Heap, 0, pszFileNameW);
|
||||||
|
HeapFree(g_hImm32Heap, 0, pszLayoutTextW);
|
||||||
|
return hKL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
Loading…
Reference in a new issue