ReactOS  0.4.13-dev-259-g5ca9c9c
locale_list.h File Reference
#include "input.h"
Include dependency graph for locale_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _LOCALE_LIST_NODE
 

Typedefs

typedef struct _LOCALE_LIST_NODE LOCALE_LIST_NODE
 

Functions

LOCALE_LIST_NODELocaleList_Create (VOID)
 
VOID LocaleList_Destroy (VOID)
 
LOCALE_LIST_NODELocaleList_GetByHkl (HKL hkl)
 
LOCALE_LIST_NODELocaleList_GetFirst (VOID)
 

Typedef Documentation

◆ LOCALE_LIST_NODE

Function Documentation

◆ LocaleList_Create()

LOCALE_LIST_NODE* LocaleList_Create ( VOID  )

Definition at line 84 of file locale_list.c.

85 {
86  WCHAR szValue[MAX_PATH];
87  DWORD dwIndex;
88  DWORD dwSize;
89  HKEY hKey;
90 
92  L"SYSTEM\\CurrentControlSet\\Control\\Nls\\Language",
93  0,
95  &hKey) != ERROR_SUCCESS)
96  {
97  return NULL;
98  }
99 
100  dwSize = ARRAYSIZE(szValue);
101  dwIndex = 0;
102 
103  while (RegEnumValueW(hKey, dwIndex, szValue, &dwSize,
105  {
107  DWORD dwId;
108 
109  dwId = DWORDfromString(szValue);
110 
111  if (GetLocaleInfoW(LOWORD(dwId),
114  {
115  LocaleList_Append(dwId, szName);
116  }
117 
118  dwSize = ARRAYSIZE(szValue);
119  ++dwIndex;
120  }
121 
122  RegCloseKey(hKey);
123 
124  return _LocaleList;
125 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define LOCALE_SLANGUAGE
Definition: winnls.h:26
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static LOCALE_LIST_NODE * _LocaleList
Definition: locale_list.c:11
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2867
smooth NULL
Definition: ftsmooth.c:416
static LOCALE_LIST_NODE * LocaleList_Append(DWORD dwId, const WCHAR *pszName)
Definition: locale_list.c:15
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define MAX_STR_LEN
Definition: defines.h:33
static DWORD DWORDfromString(const WCHAR *pszString)
Definition: input.h:78
static const WCHAR szName[]
Definition: msipriv.h:1194
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define LOWORD(l)
Definition: pedump.c:82
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by OnInitSettingsPage().

◆ LocaleList_Destroy()

VOID LocaleList_Destroy ( VOID  )

Definition at line 60 of file locale_list.c.

61 {
62  LOCALE_LIST_NODE *pCurrent;
63 
64  if (_LocaleList == NULL)
65  return;
66 
67  pCurrent = _LocaleList;
68 
69  while (pCurrent != NULL)
70  {
71  LOCALE_LIST_NODE *pNext = pCurrent->pNext;
72 
73  free(pCurrent->pszName);
74  free(pCurrent);
75 
76  pCurrent = pNext;
77  }
78 
79  _LocaleList = NULL;
80 }
#define free
Definition: debug_ros.c:5
static LOCALE_LIST_NODE * _LocaleList
Definition: locale_list.c:11
struct _LOCALE_LIST_NODE * pNext
Definition: locale_list.h:12
smooth NULL
Definition: ftsmooth.c:416

Referenced by OnDestroySettingsPage().

◆ LocaleList_GetByHkl()

LOCALE_LIST_NODE* LocaleList_GetByHkl ( HKL  hkl)

Definition at line 129 of file locale_list.c.

130 {
131  LOCALE_LIST_NODE *pCurrent;
132 
133  for (pCurrent = _LocaleList; pCurrent != NULL; pCurrent = pCurrent->pNext)
134  {
135  if (LOWORD(pCurrent->dwId) == LOWORD(hkl))
136  {
137  return pCurrent;
138  }
139  }
140 
141  return NULL;
142 }
static LOCALE_LIST_NODE * _LocaleList
Definition: locale_list.c:11
struct _LOCALE_LIST_NODE * pNext
Definition: locale_list.h:12
smooth NULL
Definition: ftsmooth.c:416
HKL hkl
Definition: msctf.idl:611
#define LOWORD(l)
Definition: pedump.c:82

Referenced by InputList_Create().

◆ LocaleList_GetFirst()

LOCALE_LIST_NODE* LocaleList_GetFirst ( VOID  )

Definition at line 146 of file locale_list.c.

147 {
148  return _LocaleList;
149 }
static LOCALE_LIST_NODE * _LocaleList
Definition: locale_list.c:11

Referenced by OnInitAddDialog().