ReactOS  0.4.15-dev-5452-g3c95c95
input_list.c File Reference
Include dependency graph for input_list.c:

Go to the source code of this file.

Classes

struct  MUI_SUBFONT
 

Macros

#define NOTHING
 

Functions

BOOL UpdateRegistryForFontSubstitutes (MUI_SUBFONT *pSubstitutes)
 
VOID GetSystemLibraryPath (LPWSTR pszPath, INT cchPath, LPCWSTR pszFileName)
 
BOOL InputList_SetFontSubstitutes (LCID dwLocaleId)
 
static INPUT_LIST_NODEInputList_AppendNode (VOID)
 
static VOID InputList_RemoveNode (INPUT_LIST_NODE *pNode)
 
VOID InputList_Destroy (VOID)
 
static BOOL InputList_PrepareUserRegistry (PHKEY phPreloadKey, PHKEY phSubstKey)
 
static BOOL InputList_FindPreloadKLID (HKEY hPreloadKey, DWORD dwKLID)
 
static BOOL InputList_WriteSubst (HKEY hSubstKey, DWORD dwPhysicalKLID, DWORD dwLogicalKLID)
 
static DWORD InputList_DoSubst (HKEY hPreloadKey, HKEY hSubstKey, DWORD dwPhysicalKLID, DWORD dwLogicalKLID)
 
static VOID InputList_AddInputMethodToUserRegistry (HKEY hPreloadKey, HKEY hSubstKey, DWORD dwNumber, INPUT_LIST_NODE *pNode)
 
BOOL InputList_Process (VOID)
 
BOOL InputList_Add (LOCALE_LIST_NODE *pLocale, LAYOUT_LIST_NODE *pLayout)
 
VOID InputList_SetDefault (INPUT_LIST_NODE *pNode)
 
INPUT_LIST_NODEInputList_FindNextDefault (INPUT_LIST_NODE *pNode)
 
BOOL InputList_Remove (INPUT_LIST_NODE *pNode)
 
BOOL InputList_RemoveByLang (LANGID wLangId)
 
VOID InputList_Create (VOID)
 
static INT InputList_Compare (INPUT_LIST_NODE *pNode1, INPUT_LIST_NODE *pNode2)
 
VOID InputList_Sort (VOID)
 
INT InputList_GetAliveCount (VOID)
 
INPUT_LIST_NODEInputList_GetFirst (VOID)
 

Variables

static INPUT_LIST_NODE_InputList = NULL
 

Macro Definition Documentation

◆ NOTHING

#define NOTHING

Definition at line 10 of file input_list.c.

Function Documentation

◆ GetSystemLibraryPath()

VOID GetSystemLibraryPath ( LPWSTR  pszPath,
INT  cchPath,
LPCWSTR  pszFileName 
)

Definition at line 42 of file input_list.c.

43 {
44  WCHAR szSysDir[MAX_PATH];
45  GetSystemDirectoryW(szSysDir, ARRAYSIZE(szSysDir));
46  StringCchPrintfW(pszPath, cchPath, L"%s\\%s", szSysDir, pszFileName);
47 }
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define L(x)
Definition: ntvdm.h:50
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313

◆ InputList_Add()

BOOL InputList_Add ( LOCALE_LIST_NODE pLocale,
LAYOUT_LIST_NODE pLayout 
)

Definition at line 482 of file input_list.c.

483 {
484  WCHAR szIndicator[MAX_STR_LEN];
485  INPUT_LIST_NODE *pInput = NULL;
486 
487  if (pLocale == NULL || pLayout == NULL)
488  {
489  return FALSE;
490  }
491 
492  for (pInput = _InputList; pInput != NULL; pInput = pInput->pNext)
493  {
494  if (pInput->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
495  continue;
496 
497  if (pInput->pLocale == pLocale && pInput->pLayout == pLayout)
498  {
499  return FALSE; /* Already exists */
500  }
501  }
502 
503  pInput = InputList_AppendNode();
505  pInput->pLocale = pLocale;
506  pInput->pLayout = pLayout;
507 
508  if (GetLocaleInfoW(LOWORD(pInput->pLocale->dwId),
510  szIndicator,
511  ARRAYSIZE(szIndicator)))
512  {
513  size_t len = wcslen(szIndicator);
514 
515  if (len > 0)
516  {
517  szIndicator[len - 1] = 0;
518  pInput->pszIndicator = _wcsdup(szIndicator);
519  }
520  }
521 
522  return TRUE;
523 }
static INPUT_LIST_NODE * InputList_AppendNode(VOID)
Definition: input_list.c:138
#define TRUE
Definition: types.h:120
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1102
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
#define FALSE
Definition: types.h:117
#define INPUT_LIST_NODE_FLAG_ADDED
Definition: input_list.h:17
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:28
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
GLenum GLsizei len
Definition: glext.h:6722
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MAX_STR_LEN
Definition: defines.h:34
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
LPWSTR pszIndicator
Definition: input_list.h:41
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
#define LOWORD(l)
Definition: pedump.c:82

Referenced by OnCommandAddDialog().

◆ InputList_AddInputMethodToUserRegistry()

static VOID InputList_AddInputMethodToUserRegistry ( HKEY  hPreloadKey,
HKEY  hSubstKey,
DWORD  dwNumber,
INPUT_LIST_NODE pNode 
)
static

Definition at line 332 of file input_list.c.

337 {
338  WCHAR szNumber[32], szLogicalKLID[KL_NAMELENGTH];
339  DWORD dwPhysicalKLID, dwLogicalKLID, cbValue;
340  HKL hKL = pNode->hkl;
341 
342  if (IS_IME_HKL(hKL)) /* IME? */
343  {
344  /* Do not substitute the IME KLID */
345  dwLogicalKLID = dwPhysicalKLID = HandleToUlong(hKL);
346  }
347  else
348  {
349  /* Substitute the KLID if necessary */
350  dwPhysicalKLID = pNode->pLayout->dwKLID;
351  dwLogicalKLID = pNode->pLocale->dwId;
352  dwLogicalKLID = InputList_DoSubst(hPreloadKey, hSubstKey, dwPhysicalKLID, dwLogicalKLID);
353  }
354 
355  /* Write the Preload value (number |--> logical KLID) */
356  StringCchPrintfW(szNumber, ARRAYSIZE(szNumber), L"%lu", dwNumber);
357  StringCchPrintfW(szLogicalKLID, ARRAYSIZE(szLogicalKLID), L"%08x", dwLogicalKLID);
358  cbValue = (wcslen(szLogicalKLID) + 1) * sizeof(WCHAR);
359  RegSetValueExW(hPreloadKey,
360  szNumber,
361  0,
362  REG_SZ,
363  (LPBYTE)szLogicalKLID,
364  cbValue);
365 
366  if ((pNode->wFlags & INPUT_LIST_NODE_FLAG_ADDED) ||
368  {
372 
373  pNode->hkl = LoadKeyboardLayoutW(szLogicalKLID, uFlags);
374  }
375 }
static DWORD InputList_DoSubst(HKEY hPreloadKey, HKEY hSubstKey, DWORD dwPhysicalKLID, DWORD dwLogicalKLID)
Definition: input_list.c:295
#define KL_NAMELENGTH
Definition: winuser.h:122
#define HandleToUlong(h)
Definition: basetsd.h:79
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define KLF_NOTELLSHELL
Definition: winuser.h:116
UINT uFlags
Definition: api.c:59
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define INPUT_LIST_NODE_FLAG_ADDED
Definition: input_list.h:17
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4899
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT_PTR HKL
Definition: msctf.idl:101
#define KLF_REPLACELANG
Definition: winuser.h:115
#define IS_IME_HKL(hKL)
Definition: input.h:88
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
HKL WINAPI LoadKeyboardLayoutW(_In_ LPCWSTR, _In_ UINT)
unsigned int UINT
Definition: ndis.h:50
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define INPUT_LIST_NODE_FLAG_EDITED
Definition: input_list.h:11
#define REG_SZ
Definition: layer.c:22

Referenced by InputList_Process().

◆ InputList_AppendNode()

static INPUT_LIST_NODE* InputList_AppendNode ( VOID  )
static

Definition at line 138 of file input_list.c.

139 {
140  INPUT_LIST_NODE *pCurrent;
141  INPUT_LIST_NODE *pNew;
142 
143  pNew = (INPUT_LIST_NODE*)malloc(sizeof(INPUT_LIST_NODE));
144  if (pNew == NULL)
145  return NULL;
146 
147  ZeroMemory(pNew, sizeof(INPUT_LIST_NODE));
148 
149  if (_InputList == NULL) /* Empty? */
150  {
151  _InputList = pNew;
152  return pNew;
153  }
154 
155  /* Find last node */
156  for (pCurrent = _InputList; pCurrent->pNext; pCurrent = pCurrent->pNext)
157  {
158  NOTHING;
159  }
160 
161  /* Add to the end */
162  pCurrent->pNext = pNew;
163  pNew->pPrev = pCurrent;
164 
165  return pNew;
166 }
#define NOTHING
Definition: input_list.c:10
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
#define ZeroMemory
Definition: winbase.h:1670
struct _INPUT_LIST_NODE * pPrev
Definition: input_list.h:43
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
#define malloc
Definition: debug_ros.c:4

Referenced by InputList_Add(), and InputList_Create().

◆ InputList_Compare()

static INT InputList_Compare ( INPUT_LIST_NODE pNode1,
INPUT_LIST_NODE pNode2 
)
static

Definition at line 695 of file input_list.c.

696 {
697  INT nCompare = _wcsicmp(pNode1->pszIndicator, pNode2->pszIndicator);
698  if (nCompare != 0)
699  return nCompare;
700 
701  return _wcsicmp(pNode1->pLayout->pszName, pNode2->pLayout->pszName);
702 }
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
int32_t INT
Definition: typedefs.h:58
LPWSTR pszIndicator
Definition: input_list.h:41
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by InputList_Sort().

◆ InputList_Create()

VOID InputList_Create ( VOID  )

Definition at line 639 of file input_list.c.

640 {
641  INT iLayoutCount, iIndex;
642  WCHAR szIndicator[MAX_STR_LEN];
643  INPUT_LIST_NODE *pInput;
644  HKL *pLayoutList, hklDefault;
645 
646  SystemParametersInfoW(SPI_GETDEFAULTINPUTLANG, 0, &hklDefault, 0);
647 
648  iLayoutCount = GetKeyboardLayoutList(0, NULL);
649  pLayoutList = (HKL*) malloc(iLayoutCount * sizeof(HKL));
650 
651  if (!pLayoutList || GetKeyboardLayoutList(iLayoutCount, pLayoutList) <= 0)
652  {
653  free(pLayoutList);
654  return;
655  }
656 
657  for (iIndex = 0; iIndex < iLayoutCount; ++iIndex)
658  {
659  HKL hKL = pLayoutList[iIndex];
660  LOCALE_LIST_NODE *pLocale = LocaleList_GetByHkl(hKL);
661  LAYOUT_LIST_NODE *pLayout = LayoutList_GetByHkl(hKL);
662  if (!pLocale || !pLayout)
663  continue;
664 
665  pInput = InputList_AppendNode();
666  pInput->pLocale = pLocale;
667  pInput->pLayout = pLayout;
668  pInput->hkl = hKL;
669 
670  if (pInput->hkl == hklDefault) /* Default HKL? */
671  {
673  hklDefault = NULL; /* No more default item */
674  }
675 
676  /* Get abbrev language name */
677  szIndicator[0] = 0;
678  if (GetLocaleInfoW(LOWORD(pInput->pLocale->dwId),
680  szIndicator,
681  ARRAYSIZE(szIndicator)))
682  {
683  size_t len = wcslen(szIndicator);
684  if (len > 0)
685  {
686  szIndicator[len - 1] = 0;
687  pInput->pszIndicator = _wcsdup(szIndicator);
688  }
689  }
690  }
691 
692  free(pLayoutList);
693 }
static INPUT_LIST_NODE * InputList_AppendNode(VOID)
Definition: input_list.c:138
#define free
Definition: debug_ros.c:5
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LAYOUT_LIST_NODE * pLayout
Definition: input_list.h:37
int32_t INT
Definition: typedefs.h:58
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1102
#define LOCALE_NOUSEROVERRIDE
Definition: winnls.h:19
LAYOUT_LIST_NODE * LayoutList_GetByHkl(HKL hkl)
Definition: layout_list.c:251
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
#define LOCALE_SABBREVLANGNAME
Definition: winnls.h:28
GLenum GLsizei len
Definition: glext.h:6722
UINT_PTR HKL
Definition: msctf.idl:101
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define NULL
Definition: types.h:112
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MAX_STR_LEN
Definition: defines.h:34
#define malloc
Definition: debug_ros.c:4
LPWSTR pszIndicator
Definition: input_list.h:41
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
#define LOWORD(l)
Definition: pedump.c:82
LOCALE_LIST_NODE * LocaleList_GetByHkl(HKL hkl)
Definition: locale_list.c:129

Referenced by OnInitSettingsPage().

◆ InputList_Destroy()

VOID InputList_Destroy ( VOID  )

Definition at line 197 of file input_list.c.

198 {
199  INPUT_LIST_NODE *pCurrent;
200  INPUT_LIST_NODE *pNext;
201 
202  if (_InputList == NULL)
203  return;
204 
205  for (pCurrent = _InputList; pCurrent; pCurrent = pNext)
206  {
207  pNext = pCurrent->pNext;
208 
209  free(pCurrent->pszIndicator);
210  free(pCurrent);
211  }
212 
213  _InputList = NULL;
214 }
#define free
Definition: debug_ros.c:5
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
LPWSTR pszIndicator
Definition: input_list.h:41

Referenced by OnDestroySettingsPage().

◆ InputList_DoSubst()

static DWORD InputList_DoSubst ( HKEY  hPreloadKey,
HKEY  hSubstKey,
DWORD  dwPhysicalKLID,
DWORD  dwLogicalKLID 
)
static

Definition at line 295 of file input_list.c.

297 {
298  DWORD iTrial;
299  BOOL bSubstNeeded = (dwPhysicalKLID != dwLogicalKLID) || (HIWORD(dwPhysicalKLID) != 0);
300 
301  for (iTrial = 1; iTrial <= 1000; ++iTrial)
302  {
303  if (!InputList_FindPreloadKLID(hPreloadKey, dwLogicalKLID)) /* Not found? */
304  {
305  if (bSubstNeeded)
306  {
307  /* Write now */
308  InputList_WriteSubst(hSubstKey, dwPhysicalKLID, dwLogicalKLID);
309  }
310  return dwLogicalKLID;
311  }
312 
313  bSubstNeeded = TRUE;
314 
315  /* Calculate the next logical KLID */
316  if (!IS_SUBST_KLID(dwLogicalKLID))
317  {
318  dwLogicalKLID |= SUBST_MASK;
319  }
320  else
321  {
322  WORD wLow = LOWORD(dwLogicalKLID);
323  WORD wHigh = HIWORD(dwLogicalKLID);
324  dwLogicalKLID = MAKELONG(wLow, wHigh + 1);
325  }
326  }
327 
328  return 0;
329 }
#define TRUE
Definition: types.h:120
#define IS_SUBST_KLID(dwKLID)
Definition: input.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MAKELONG(a, b)
Definition: typedefs.h:249
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define HIWORD(l)
Definition: typedefs.h:247
#define SUBST_MASK
Definition: input.h:85
static BOOL InputList_WriteSubst(HKEY hSubstKey, DWORD dwPhysicalKLID, DWORD dwLogicalKLID)
Definition: input_list.c:281
#define LOWORD(l)
Definition: pedump.c:82
static BOOL InputList_FindPreloadKLID(HKEY hPreloadKey, DWORD dwKLID)
Definition: input_list.c:251

Referenced by InputList_AddInputMethodToUserRegistry().

◆ InputList_FindNextDefault()

INPUT_LIST_NODE* InputList_FindNextDefault ( INPUT_LIST_NODE pNode)

Definition at line 548 of file input_list.c.

549 {
550  INPUT_LIST_NODE *pCurrent;
551 
552  for (pCurrent = pNode->pNext; pCurrent; pCurrent = pCurrent->pNext)
553  {
554  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
555  continue;
556 
557  return pCurrent;
558  }
559 
560  for (pCurrent = pNode->pPrev; pCurrent; pCurrent = pCurrent->pPrev)
561  {
562  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
563  continue;
564 
565  return pCurrent;
566  }
567 
568  return NULL;
569 }
struct _INPUT_LIST_NODE * pPrev
Definition: input_list.h:43
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44

Referenced by InputList_Remove().

◆ InputList_FindPreloadKLID()

static BOOL InputList_FindPreloadKLID ( HKEY  hPreloadKey,
DWORD  dwKLID 
)
static

Definition at line 251 of file input_list.c.

252 {
253  DWORD dwNumber, dwType, cbValue;
254  WCHAR szNumber[16], szValue[KL_NAMELENGTH], szKLID[KL_NAMELENGTH];
255 
256  StringCchPrintfW(szKLID, ARRAYSIZE(szKLID), L"%08x", dwKLID);
257 
258  for (dwNumber = 1; dwNumber <= 1000; ++dwNumber)
259  {
260  StringCchPrintfW(szNumber, ARRAYSIZE(szNumber), L"%u", dwNumber);
261 
262  cbValue = ARRAYSIZE(szValue) * sizeof(WCHAR);
263  if (RegQueryValueExW(hPreloadKey, szNumber, NULL, &dwType,
264  (LPBYTE)szValue, &cbValue) != ERROR_SUCCESS)
265  {
266  break;
267  }
268 
269  if (dwType != REG_SZ)
270  continue;
271 
272  szValue[ARRAYSIZE(szValue) - 1] = 0;
273  if (_wcsicmp(szKLID, szValue) == 0)
274  return TRUE;
275  }
276 
277  return FALSE;
278 }
#define KL_NAMELENGTH
Definition: winuser.h:122
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
#define NULL
Definition: types.h:112
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define REG_SZ
Definition: layer.c:22

Referenced by InputList_DoSubst().

◆ InputList_GetAliveCount()

INT InputList_GetAliveCount ( VOID  )

Definition at line 763 of file input_list.c.

764 {
765  INPUT_LIST_NODE *pNode;
766  INT nCount = 0;
767 
768  for (pNode = _InputList; pNode; pNode = pNode->pNext)
769  {
771  continue;
772 
773  ++nCount;
774  }
775 
776  return nCount;
777 }
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
int32_t INT
Definition: typedefs.h:58
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44

Referenced by UpdateInputListView().

◆ InputList_GetFirst()

INPUT_LIST_NODE* InputList_GetFirst ( VOID  )

Definition at line 780 of file input_list.c.

781 {
782  return _InputList;
783 }
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134

Referenced by InitDefaultLangComboBox(), IsRebootNeeded(), and UpdateInputListView().

◆ InputList_PrepareUserRegistry()

static BOOL InputList_PrepareUserRegistry ( PHKEY  phPreloadKey,
PHKEY  phSubstKey 
)
static

Definition at line 218 of file input_list.c.

219 {
220  BOOL bResult = FALSE;
221  HKEY hKey;
222 
223  *phPreloadKey = *phSubstKey = NULL;
224 
226  L"Keyboard Layout",
227  0,
229  &hKey) == ERROR_SUCCESS)
230  {
231  RegDeleteKeyW(hKey, L"Preload");
232  RegDeleteKeyW(hKey, L"Substitutes");
233 
234  RegCloseKey(hKey);
235  }
236 
237  if (RegCreateKeyW(HKEY_CURRENT_USER, L"Keyboard Layout", &hKey) == ERROR_SUCCESS &&
238  RegCreateKeyW(hKey, L"Preload", phPreloadKey) == ERROR_SUCCESS &&
239  RegCreateKeyW(hKey, L"Substitutes", phSubstKey) == ERROR_SUCCESS)
240  {
241  bResult = TRUE;
242  }
243 
244  if (hKey)
245  RegCloseKey(hKey);
246 
247  return bResult;
248 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define HKEY_CURRENT_USER
Definition: winreg.h:11
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
Definition: reg.c:1237
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1199
FxAutoRegKey hKey
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define NULL
Definition: types.h:112
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define RegCloseKey(hKey)
Definition: registry.h:47

Referenced by InputList_Process().

◆ InputList_Process()

BOOL InputList_Process ( VOID  )

Definition at line 382 of file input_list.c.

383 {
384  INPUT_LIST_NODE *pCurrent;
385  DWORD dwNumber;
386  BOOL bRet = FALSE;
387  HKEY hPreloadKey, hSubstKey;
388 
389  if (!InputList_PrepareUserRegistry(&hPreloadKey, &hSubstKey))
390  {
391  if (hPreloadKey)
392  RegCloseKey(hPreloadKey);
393  if (hSubstKey)
394  RegCloseKey(hSubstKey);
395  return FALSE;
396  }
397 
398  /* Process DELETED and EDITED entries */
399  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
400  {
401  if ((pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED) ||
402  (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_EDITED))
403  {
404  /* Only unload the DELETED and EDITED entries */
405  if (UnloadKeyboardLayout(pCurrent->hkl))
406  {
407  /* But the EDITED entries are used later */
408  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
409  {
410  InputList_RemoveNode(pCurrent);
411  }
412  }
413  }
414  }
415 
416  /* Add the DEFAULT entry and set font substitutes */
417  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
418  {
419  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
420  continue;
421 
422  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT)
423  {
424  bRet = InputList_SetFontSubstitutes(pCurrent->pLocale->dwId);
425  InputList_AddInputMethodToUserRegistry(hPreloadKey, hSubstKey, 1, pCurrent);
426 
427  /* Activate the DEFAULT entry */
428  ActivateKeyboardLayout(pCurrent->hkl, KLF_RESET);
429  break;
430  }
431  }
432 
433  /* Add entries except DEFAULT to registry */
434  dwNumber = 2;
435  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
436  {
437  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
438  continue;
439  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DEFAULT)
440  continue;
441 
442  InputList_AddInputMethodToUserRegistry(hPreloadKey, hSubstKey, dwNumber, pCurrent);
443 
444  ++dwNumber;
445  }
446 
447  /* Remove ADDED and EDITED flags */
448  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
449  {
451  }
452 
453  /* Change the default keyboard language */
454  if (SystemParametersInfoW(SPI_SETDEFAULTINPUTLANG, 0, &pCurrent->hkl, 0))
455  {
456  DWORD dwRecipients = BSM_ALLDESKTOPS | BSM_APPLICATIONS;
457 
459  &dwRecipients,
460  WM_INPUTLANGCHANGEREQUEST,
461  INPUTLANGCHANGE_SYSCHARSET,
462  (LPARAM)pCurrent->hkl);
463  }
464 
465  /* Retry to delete (in case of failure to delete the default keyboard) */
466  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
467  {
468  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
469  {
470  UnloadKeyboardLayout(pCurrent->hkl);
471  InputList_RemoveNode(pCurrent);
472  }
473  }
474 
475  RegCloseKey(hPreloadKey);
476  RegCloseKey(hSubstKey);
477  return bRet;
478 }
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)
LONG WINAPI BroadcastSystemMessageW(DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
Definition: message.c:3408
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
BOOL InputList_SetFontSubstitutes(LCID dwLocaleId)
Definition: input_list.c:50
static VOID InputList_AddInputMethodToUserRegistry(HKEY hPreloadKey, HKEY hSubstKey, DWORD dwNumber, INPUT_LIST_NODE *pNode)
Definition: input_list.c:332
#define BSF_POSTMESSAGE
Definition: dbt.h:58
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID InputList_RemoveNode(INPUT_LIST_NODE *pNode)
Definition: input_list.c:170
LONG_PTR LPARAM
Definition: windef.h:208
#define INPUT_LIST_NODE_FLAG_ADDED
Definition: input_list.h:17
static BOOL InputList_PrepareUserRegistry(PHKEY phPreloadKey, PHKEY phSubstKey)
Definition: input_list.c:218
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define NULL
Definition: types.h:112
#define BSM_ALLDESKTOPS
Definition: dbt.h:49
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
#define RegCloseKey(hKey)
Definition: registry.h:47
#define BSM_APPLICATIONS
Definition: dbt.h:48
#define INPUT_LIST_NODE_FLAG_EDITED
Definition: input_list.h:11

Referenced by OnNotifySettingsPage().

◆ InputList_Remove()

BOOL InputList_Remove ( INPUT_LIST_NODE pNode)

Definition at line 576 of file input_list.c.

577 {
578  BOOL ret = FALSE;
579  BOOL bRemoveNode = FALSE;
580 
581  if (pNode == NULL)
582  return FALSE;
583 
584  if (pNode->wFlags & INPUT_LIST_NODE_FLAG_ADDED)
585  {
586  /*
587  * If the input method has been added to the list, but not yet written
588  * in the registry, then simply remove it from the list
589  */
590  bRemoveNode = TRUE;
591  }
592  else
593  {
595  }
596 
598  {
599  INPUT_LIST_NODE *pCurrent = InputList_FindNextDefault(pNode);
600  if (pCurrent)
602 
604  ret = TRUE; /* default input is changed */
605  }
606 
607  if (bRemoveNode)
608  {
609  InputList_RemoveNode(pNode);
610  }
611 
612  return ret;
613 }
#define TRUE
Definition: types.h:120
INPUT_LIST_NODE * InputList_FindNextDefault(INPUT_LIST_NODE *pNode)
Definition: input_list.c:548
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID InputList_RemoveNode(INPUT_LIST_NODE *pNode)
Definition: input_list.c:170
#define INPUT_LIST_NODE_FLAG_ADDED
Definition: input_list.h:17
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
int ret
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
#define NULL
Definition: types.h:112

Referenced by InputList_RemoveByLang(), and OnCommandSettingsPage().

◆ InputList_RemoveByLang()

BOOL InputList_RemoveByLang ( LANGID  wLangId)

Definition at line 616 of file input_list.c.

617 {
618  BOOL ret = FALSE;
619  INPUT_LIST_NODE *pCurrent;
620 
621 Retry:
622  for (pCurrent = _InputList; pCurrent; pCurrent = pCurrent->pNext)
623  {
624  if (pCurrent->wFlags & INPUT_LIST_NODE_FLAG_DELETED)
625  continue;
626 
627  if (LOWORD(pCurrent->pLocale->dwId) == wLangId)
628  {
629  if (InputList_Remove(pCurrent))
630  ret = TRUE; /* default input is changed */
631  goto Retry;
632  }
633  }
634 
635  return ret;
636 }
#define TRUE
Definition: types.h:120
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
LOCALE_LIST_NODE * pLocale
Definition: input_list.h:36
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL InputList_Remove(INPUT_LIST_NODE *pNode)
Definition: input_list.c:576
int ret
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:310
#define INPUT_LIST_NODE_FLAG_DELETED
Definition: input_list.h:24
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
#define LOWORD(l)
Definition: pedump.c:82

Referenced by OnCommandSettingsPage().

◆ InputList_RemoveNode()

static VOID InputList_RemoveNode ( INPUT_LIST_NODE pNode)
static

Definition at line 170 of file input_list.c.

171 {
172  INPUT_LIST_NODE *pCurrent = pNode;
173 
174  if (_InputList == NULL)
175  return;
176 
177  if (pCurrent != NULL)
178  {
179  INPUT_LIST_NODE *pNext = pCurrent->pNext;
180  INPUT_LIST_NODE *pPrev = pCurrent->pPrev;
181 
182  free(pCurrent->pszIndicator);
183  free(pCurrent);
184 
185  if (pNext != NULL)
186  pNext->pPrev = pPrev;
187 
188  if (pPrev != NULL)
189  pPrev->pNext = pNext;
190  else
191  _InputList = pNext;
192  }
193 }
#define free
Definition: debug_ros.c:5
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
struct _INPUT_LIST_NODE * pPrev
Definition: input_list.h:43
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
LPWSTR pszIndicator
Definition: input_list.h:41

Referenced by InputList_Process(), and InputList_Remove().

◆ InputList_SetDefault()

VOID InputList_SetDefault ( INPUT_LIST_NODE pNode)

Definition at line 527 of file input_list.c.

528 {
529  INPUT_LIST_NODE *pCurrent;
530 
531  if (pNode == NULL)
532  return;
533 
534  for (pCurrent = _InputList; pCurrent != NULL; pCurrent = pCurrent->pNext)
535  {
536  if (pCurrent == pNode)
537  {
539  }
540  else
541  {
542  pCurrent->wFlags &= ~INPUT_LIST_NODE_FLAG_DEFAULT;
543  }
544  }
545 }
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
#define INPUT_LIST_NODE_FLAG_DEFAULT
Definition: input_list.h:30
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44

Referenced by OnCommandSettingsPage().

◆ InputList_SetFontSubstitutes()

BOOL InputList_SetFontSubstitutes ( LCID  dwLocaleId)

Definition at line 50 of file input_list.c.

51 {
52  MUI_SUBFONT *pSubstitutes;
53  WORD wLangID, wPrimaryLangID, wSubLangID;
54 
55  wLangID = LANGIDFROMLCID(dwLocaleId);
56  wPrimaryLangID = PRIMARYLANGID(wLangID);
57  wSubLangID = SUBLANGID(wLangID);
58 
59  /* FIXME: Add more if necessary */
60  switch (wPrimaryLangID)
61  {
62  default:
63  pSubstitutes = LatinFonts;
64  break;
65  case LANG_AZERI:
66  case LANG_BELARUSIAN:
67  case LANG_BULGARIAN:
68  case LANG_KAZAK:
69  case LANG_RUSSIAN:
70  case LANG_SERBIAN:
71  case LANG_TATAR:
72  case LANG_UKRAINIAN:
73  case LANG_UZBEK:
74  pSubstitutes = CyrillicFonts;
75  break;
76  case LANG_GREEK:
77  pSubstitutes = GreekFonts;
78  break;
79  case LANG_HEBREW:
80  pSubstitutes = HebrewFonts;
81  break;
82  case LANG_CHINESE:
83  switch (wSubLangID)
84  {
87  pSubstitutes = ChineseSimplifiedFonts;
88  break;
92  pSubstitutes = ChineseTraditionalFonts;
93  break;
94  default:
95  pSubstitutes = NULL;
96  DebugBreak();
97  break;
98  }
99  break;
100  case LANG_JAPANESE:
101  pSubstitutes = JapaneseFonts;
102  break;
103  case LANG_KOREAN:
104  pSubstitutes = KoreanFonts;
105  break;
106  case LANG_ARABIC:
107  case LANG_ARMENIAN:
108  case LANG_BENGALI:
109  case LANG_FARSI:
110  case LANG_GEORGIAN:
111  case LANG_GUJARATI:
112  case LANG_HINDI:
113  case LANG_KONKANI:
114  case LANG_MARATHI:
115  case LANG_PUNJABI:
116  case LANG_SANSKRIT:
117  case LANG_TAMIL:
118  case LANG_TELUGU:
119  case LANG_THAI:
120  case LANG_URDU:
121  case LANG_VIETNAMESE:
122  pSubstitutes = UnicodeFonts;
123  break;
124  }
125 
126  if (pSubstitutes)
127  {
128  UpdateRegistryForFontSubstitutes(pSubstitutes);
129  return TRUE;
130  }
131  return FALSE;
132 }
#define LANG_UZBEK
Definition: nls.h:142
#define LANG_BELARUSIAN
Definition: nls.h:35
#define SUBLANG_CHINESE_TRADITIONAL
Definition: nls.h:208
#define TRUE
Definition: types.h:120
#define LANG_THAI
Definition: nls.h:132
#define LANG_HINDI
Definition: nls.h:68
#define LANG_AZERI
Definition: nls.h:32
#define SUBLANG_CHINESE_HONGKONG
Definition: nls.h:210
#define LANG_ARABIC
Definition: nls.h:29
Definition: mui.h:3
#define SUBLANG_CHINESE_SINGAPORE
Definition: nls.h:211
#define LANG_BENGALI
Definition: nls.h:36
#define LANG_HEBREW
Definition: nls.h:67
#define LANG_SERBIAN
Definition: nls.h:116
#define LANG_BULGARIAN
Definition: nls.h:40
#define LANG_JAPANESE
Definition: nls.h:76
#define FALSE
Definition: types.h:117
MUI_SUBFONT LatinFonts[]
Definition: muifonts.h:3
void WINAPI DebugBreak(void)
#define LANG_KONKANI
Definition: nls.h:83
#define LANG_TELUGU
Definition: nls.h:131
#define LANG_TATAR
Definition: nls.h:130
MUI_SUBFONT HebrewFonts[]
Definition: muifonts.h:97
MUI_SUBFONT KoreanFonts[]
Definition: muifonts.h:287
MUI_SUBFONT CyrillicFonts[]
Definition: muifonts.h:35
#define LANG_SANSKRIT
Definition: nls.h:115
#define LANG_URDU
Definition: nls.h:141
unsigned short WORD
Definition: ntddk_ex.h:93
#define LANG_RUSSIAN
Definition: nls.h:113
#define LANGIDFROMLCID(l)
Definition: nls.h:18
#define SUBLANG_CHINESE_SIMPLIFIED
Definition: nls.h:209
#define LANG_VIETNAMESE
Definition: nls.h:143
#define LANG_MARATHI
Definition: nls.h:98
MUI_SUBFONT JapaneseFonts[]
Definition: muifonts.h:235
MUI_SUBFONT ChineseTraditionalFonts[]
Definition: muifonts.h:184
#define LANG_PUNJABI
Definition: nls.h:109
MUI_SUBFONT UnicodeFonts[]
Definition: muifonts.h:337
#define SUBLANG_CHINESE_MACAU
Definition: nls.h:212
#define LANG_UKRAINIAN
Definition: nls.h:139
MUI_SUBFONT ChineseSimplifiedFonts[]
Definition: muifonts.h:133
#define LANG_FARSI
Definition: nls.h:55
#define NULL
Definition: types.h:112
BOOL UpdateRegistryForFontSubstitutes(MUI_SUBFONT *pSubstitutes)
Definition: input_list.c:20
#define LANG_CHINESE
Definition: nls.h:42
#define LANG_ARMENIAN
Definition: nls.h:30
#define LANG_KOREAN
Definition: nls.h:84
#define LANG_TAMIL
Definition: nls.h:129
#define LANG_GEORGIAN
Definition: nls.h:61
#define LANG_KAZAK
Definition: nls.h:79
MUI_SUBFONT GreekFonts[]
Definition: muifonts.h:66
#define LANG_GREEK
Definition: nls.h:63
#define LANG_GUJARATI
Definition: nls.h:65
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define SUBLANGID(l)
Definition: nls.h:17

Referenced by InputList_Process().

◆ InputList_Sort()

VOID InputList_Sort ( VOID  )

Definition at line 704 of file input_list.c.

705 {
707  INPUT_LIST_NODE *pNext, *pPrev;
708  INPUT_LIST_NODE *pMinimum, *pNode;
709 
710  _InputList = NULL;
711 
712  while (pList)
713  {
714  /* Find the minimum node */
715  pMinimum = NULL;
716  for (pNode = pList; pNode; pNode = pNext)
717  {
718  pNext = pNode->pNext;
719 
720  if (pMinimum == NULL)
721  {
722  pMinimum = pNode;
723  }
724  else if (InputList_Compare(pNode, pMinimum) < 0)
725  {
726  pMinimum = pNode;
727  }
728  }
729 
730  // Remove pMinimum from pList
731  pNext = pMinimum->pNext;
732  pPrev = pMinimum->pPrev;
733  if (pNext)
734  pNext->pPrev = pPrev;
735  if (pPrev)
736  pPrev->pNext = pNext;
737  else
738  pList = pNext;
739 
740  // Append pMinimum to _InputList
741  if (!_InputList)
742  {
743  pMinimum->pPrev = pMinimum->pNext = NULL;
744  _InputList = pMinimum;
745  }
746  else
747  {
748  /* Find last node */
749  for (pNode = _InputList; pNode->pNext; pNode = pNode->pNext)
750  {
751  NOTHING;
752  }
753 
754  /* Add to the end */
755  pNode->pNext = pMinimum;
756  pMinimum->pPrev = pNode;
757  pMinimum->pNext = NULL;
758  }
759  }
760 }
#define NOTHING
Definition: input_list.c:10
static INPUT_LIST_NODE * _InputList
Definition: input_list.c:134
struct _INPUT_LIST_NODE * pPrev
Definition: input_list.h:43
FxChildList * pList
#define NULL
Definition: types.h:112
struct _INPUT_LIST_NODE * pNext
Definition: input_list.h:44
static INT InputList_Compare(INPUT_LIST_NODE *pNode1, INPUT_LIST_NODE *pNode2)
Definition: input_list.c:695

Referenced by UpdateInputListView().

◆ InputList_WriteSubst()

static BOOL InputList_WriteSubst ( HKEY  hSubstKey,
DWORD  dwPhysicalKLID,
DWORD  dwLogicalKLID 
)
static

Definition at line 281 of file input_list.c.

282 {
283  DWORD cbValue;
284  WCHAR szLogicalKLID[KL_NAMELENGTH], szPhysicalKLID[KL_NAMELENGTH];
285 
286  StringCchPrintfW(szLogicalKLID, ARRAYSIZE(szLogicalKLID), L"%08x", dwLogicalKLID);
287  StringCchPrintfW(szPhysicalKLID, ARRAYSIZE(szPhysicalKLID), L"%08x", dwPhysicalKLID);
288 
289  cbValue = (wcslen(szPhysicalKLID) + 1) * sizeof(WCHAR);
290  return RegSetValueExW(hSubstKey, szLogicalKLID, 0, REG_SZ, (LPBYTE)szPhysicalKLID,
291  cbValue) == ERROR_SUCCESS;
292 }
#define KL_NAMELENGTH
Definition: winuser.h:122
#define ERROR_SUCCESS
Definition: deptool.c:10
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4899
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define REG_SZ
Definition: layer.c:22

Referenced by InputList_DoSubst().

◆ UpdateRegistryForFontSubstitutes()

BOOL UpdateRegistryForFontSubstitutes ( MUI_SUBFONT pSubstitutes)

Definition at line 20 of file input_list.c.

21 {
22  DWORD cbData;
23  HKEY hKey;
24  static const WCHAR pszKey[] =
25  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes";
26 
28  return FALSE;
29 
30  /* Overwrite only */
31  for (; pSubstitutes->FontName; ++pSubstitutes)
32  {
33  cbData = (lstrlenW(pSubstitutes->SubFontName) + 1) * sizeof(WCHAR);
34  RegSetValueExW(hKey, pSubstitutes->FontName, 0,
35  REG_SZ, (LPBYTE)pSubstitutes->SubFontName, cbData);
36  }
37 
39  return TRUE;
40 }
PCWSTR SubFontName
Definition: mui.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRUE
Definition: types.h:120
#define lstrlenW
Definition: compat.h:750
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4899
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
PCWSTR FontName
Definition: mui.h:5
FxAutoRegKey hKey
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
#define RegCloseKey(hKey)
Definition: registry.h:47
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

Referenced by InputList_SetFontSubstitutes().

Variable Documentation

◆ _InputList