190{
191
195 return 0;
196
198 WCHAR szImeFileName[80], szImeKey[20];
201 for (iKey = nCount = 0; ; ++iKey)
202 {
203
206 break;
207
208 if (szImeKey[0] !=
L'E' && szImeKey[0] !=
L'e')
209 continue;
210
211 if (pLayouts ==
NULL)
212 {
213 ++nCount;
214 continue;
215 }
216
217 if (cLayouts <= nCount)
218 break;
219
221 lError =
RegOpenKeyW(hkeyLayouts, szImeKey, &hkeyIME);
223 continue;
224
225
227 cbData = sizeof(szImeFileName);
230
232
233
234 if (!szImeFileName[0] ||
wcscspn(szImeFileName,
L":\\/") !=
wcslen(szImeFileName))
235 {
237 continue;
238 }
239
243 {
244 WARN(
"Not IMM IME HKL: %p\n", hKL);
245 continue;
246 }
247
248
249 pLayouts[nCount].hKL = hKL;
252 szImeFileName);
253 ++nCount;
254 }
255
257 return nCount;
258}
#define RegCloseKey(hKey)
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegEnumKeyW(HKEY hKey, DWORD dwIndex, LPWSTR lpName, DWORD cbName)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Check_return_ _CRTIMP size_t __cdecl wcscspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define REGKEY_KEYBOARD_LAYOUTS
#define IS_ERROR_UNEXPECTEDLY(x)
HRESULT Imm32StrToUInt(_In_ PCWSTR pszText, _Out_ PDWORD pdwValue, _In_ ULONG nBase)
#define HKEY_LOCAL_MACHINE