ReactOS 0.4.15-dev-8428-g6910fa6
layout_list.h File Reference
#include "input.h"
Include dependency graph for layout_list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _LAYOUT_LIST_NODE
 

Typedefs

typedef struct _LAYOUT_LIST_NODE LAYOUT_LIST_NODE
 

Functions

VOID LayoutList_Create (VOID)
 
VOID LayoutList_Destroy (VOID)
 
LAYOUT_LIST_NODELayoutList_GetByHkl (HKL hkl)
 
LAYOUT_LIST_NODELayoutList_GetFirst (VOID)
 

Typedef Documentation

◆ LAYOUT_LIST_NODE

Function Documentation

◆ LayoutList_Create()

VOID LayoutList_Create ( VOID  )

Definition at line 171 of file layout_list.c.

172{
173 WCHAR szSystemDirectory[MAX_PATH], szKLID[KL_NAMELENGTH];
174 DWORD dwSize, dwIndex;
175 HKEY hKey, hLayoutKey;
176
177 if (!GetSystemDirectoryW(szSystemDirectory, ARRAYSIZE(szSystemDirectory)))
178 return;
179
180 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts",
181 0, KEY_READ, &hKey) != ERROR_SUCCESS)
182 {
183 return;
184 }
185
186 for (dwIndex = 0; ; ++dwIndex)
187 {
188 dwSize = ARRAYSIZE(szKLID);
189 if (RegEnumKeyExW(hKey, dwIndex, szKLID, &dwSize, NULL, NULL,
191 {
192 break;
193 }
194
195 if (RegOpenKeyExW(hKey, szKLID, 0, KEY_QUERY_VALUE, &hLayoutKey) == ERROR_SUCCESS)
196 {
197 LayoutList_ReadLayout(hLayoutKey, szKLID, szSystemDirectory);
198 RegCloseKey(hLayoutKey);
199 }
200 }
201
203}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
static BOOL LayoutList_ReadLayout(HKEY hLayoutKey, LPCWSTR szKLID, LPCWSTR szSystemDirectory)
Definition: layout_list.c:103
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
#define KEY_READ
Definition: nt_native.h:1023
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define L(x)
Definition: ntvdm.h:50
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KL_NAMELENGTH
Definition: winuser.h:122
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by OnInitSettingsPage().

◆ LayoutList_Destroy()

VOID LayoutList_Destroy ( VOID  )

Definition at line 67 of file layout_list.c.

68{
69 LAYOUT_LIST_NODE *pCurrent;
70 LAYOUT_LIST_NODE *pNext;
71
72 if (_LayoutList == NULL)
73 return;
74
75 for (pCurrent = _LayoutList; pCurrent; pCurrent = pNext)
76 {
77 pNext = pCurrent->pNext;
78
79 free(pCurrent->pszName);
80 free(pCurrent->pszFile);
81 free(pCurrent->pszImeFile);
82 free(pCurrent);
83 }
84
86}
#define free
Definition: debug_ros.c:5
static LAYOUT_LIST_NODE * _LayoutList
Definition: layout_list.c:11
struct _LAYOUT_LIST_NODE * pNext
Definition: layout_list.h:14

Referenced by OnDestroySettingsPage().

◆ LayoutList_GetByHkl()

LAYOUT_LIST_NODE * LayoutList_GetByHkl ( HKL  hkl)

Definition at line 207 of file layout_list.c.

208{
209 LAYOUT_LIST_NODE *pCurrent;
210
211 if (IS_SPECIAL_HKL(hkl))
212 {
213 WORD wSpecialId = SPECIALIDFROMHKL(hkl);
214
215 for (pCurrent = _LayoutList; pCurrent != NULL; pCurrent = pCurrent->pNext)
216 {
217 if (wSpecialId == pCurrent->wSpecialId)
218 {
219 return pCurrent;
220 }
221 }
222 }
223 else if (IS_IME_HKL(hkl))
224 {
225 for (pCurrent = _LayoutList; pCurrent != NULL; pCurrent = pCurrent->pNext)
226 {
227 if (hkl == UlongToHandle(pCurrent->dwKLID))
228 {
229 return pCurrent;
230 }
231 }
232 }
233 else
234 {
235 for (pCurrent = _LayoutList; pCurrent != NULL; pCurrent = pCurrent->pNext)
236 {
237 if (HIWORD(hkl) == LOWORD(pCurrent->dwKLID))
238 {
239 return pCurrent;
240 }
241 }
242 }
243
244 return NULL;
245}
#define UlongToHandle(ul)
Definition: basetsd.h:97
unsigned short WORD
Definition: ntddk_ex.h:93
#define SPECIALIDFROMHKL(hKL)
Definition: imm32_undoc.h:22
#define IS_SPECIAL_HKL(hKL)
Definition: imm32_undoc.h:21
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
HKL hkl
Definition: msctf.idl:650
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247

Referenced by InputList_Create().

◆ LayoutList_GetFirst()

LAYOUT_LIST_NODE * LayoutList_GetFirst ( VOID  )

Definition at line 249 of file layout_list.c.

250{
251 return _LayoutList;
252}

Referenced by EditDialogProc(), and OnInitAddDialog().