18#include "../../../base/setup/lib/muifonts.h"
24 static const WCHAR pszKey[] =
25 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes";
31 for (; pSubstitutes->
FontName; ++pSubstitutes)
53 WORD wLangID, wPrimaryLangID, wSubLangID;
60 switch (wPrimaryLangID)
162 pCurrent->
pNext = pNew;
163 pNew->
pPrev = pCurrent;
177 if (pCurrent !=
NULL)
186 pNext->
pPrev = pPrev;
189 pPrev->
pNext = pNext;
205 for (pCurrent =
_InputList; pCurrent; pCurrent = pNext)
207 pNext = pCurrent->
pNext;
223 *phPreloadKey = *phSubstKey =
NULL;
253 DWORD dwNumber, dwType, cbValue;
258 for (dwNumber = 1; dwNumber <= 1000; ++dwNumber)
289 cbValue = (
wcslen(szPhysicalKLID) + 1) *
sizeof(
WCHAR);
299 BOOL bSubstNeeded = (dwPhysicalKLID != dwLogicalKLID) || (
HIWORD(dwPhysicalKLID) != 0);
301 for (iTrial = 1; iTrial <= 1000; ++iTrial)
310 return dwLogicalKLID;
324 dwLogicalKLID =
MAKELONG(wLow, wHigh + 1);
339 DWORD dwPhysicalKLID, dwLogicalKLID, cbValue;
352 dwLogicalKLID =
InputList_DoSubst(hPreloadKey, hSubstKey, dwPhysicalKLID, dwLogicalKLID);
358 cbValue = (
wcslen(szLogicalKLID) + 1) *
sizeof(
WCHAR);
387 HKEY hPreloadKey, hSubstKey;
448 hDefaultKL = pCurrent->
hkl;
480 WM_INPUTLANGCHANGEREQUEST,
481 INPUTLANGCHANGE_SYSCHARSET,
507 if (pLocale ==
NULL || pLayout ==
NULL)
537 szIndicator[
len - 1] = 0;
556 if (pCurrent == pNode)
562 pCurrent->
wFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT;
572 for (pCurrent = pNode->
pNext; pCurrent; pCurrent = pCurrent->
pNext)
580 for (pCurrent = pNode->
pPrev; pCurrent; pCurrent = pCurrent->
pPrev)
623 pNode->
wFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT;
661 INT iLayoutCount, iIndex;
664 HKL *pLayoutList, hklDefault;
669 pLayoutList = (
HKL*)
malloc(iLayoutCount *
sizeof(
HKL));
677 for (iIndex = 0; iIndex < iLayoutCount; ++iIndex)
679 HKL hKL = pLayoutList[iIndex];
682 if (!pLocale || !pLayout)
690 if (pInput->
hkl == hklDefault)
706 szIndicator[
len - 1] = 0;
736 for (pNode =
pList; pNode; pNode = pNext)
738 pNext = pNode->
pNext;
740 if (pMinimum ==
NULL)
751 pNext = pMinimum->
pNext;
752 pPrev = pMinimum->
pPrev;
754 pNext->
pPrev = pPrev;
756 pPrev->
pNext = pNext;
775 pNode->
pNext = pMinimum;
776 pMinimum->
pPrev = pNode;
#define RegCloseKey(hKey)
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
#define IS_SUBST_KLID(dwKLID)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
LAYOUT_LIST_NODE * LayoutList_GetByHkl(HKL hkl)
LOCALE_LIST_NODE * LocaleList_GetByHkl(HKL hkl)
MUI_SUBFONT UnicodeFonts[]
MUI_SUBFONT KoreanFonts[]
MUI_SUBFONT ChineseSimplifiedFonts[]
MUI_SUBFONT HebrewFonts[]
MUI_SUBFONT ChineseTraditionalFonts[]
MUI_SUBFONT CyrillicFonts[]
MUI_SUBFONT JapaneseFonts[]
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
#define SUBLANG_CHINESE_SINGAPORE
#define SUBLANG_CHINESE_MACAU
#define LANGIDFROMLCID(l)
#define SUBLANG_CHINESE_TRADITIONAL
#define SUBLANG_CHINESE_SIMPLIFIED
#define SUBLANG_CHINESE_HONGKONG
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
WORD WORD PSZ PSZ pszFileName
LONG WINAPI BroadcastSystemMessageW(DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
void WINAPI DebugBreak(void)
#define LOCALE_NOUSEROVERRIDE
#define LOCALE_SABBREVLANGNAME
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
#define KLF_SUBSTITUTE_OK
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)