#include "precomp.h"
#include "mui.h"
#include "muifonts.h"
#include "muilanguages.h"
#include "registry.h"
#include "substset.h"
#include <debug.h>
Go to the source code of this file.
◆ NDEBUG
Definition at line 36 of file mui.c.
◆ AddCodePage()
Definition at line 535 of file mui.c.
537{
539
541 {
543 {
548 {
550 }
551 else
552 {
554 }
555 }
556
557 lngIndex++;
558 }
559
561}
static BOOLEAN AddFontsSettingsToRegistry(IN const MUI_SUBFONT *MuiSubFonts)
static BOOLEAN AddCodepageToRegistry(IN PCWSTR ACPage, IN PCWSTR OEMCPage, IN PCWSTR MACCPage)
const MUI_LANGUAGE MUILanguageList[]
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
Referenced by UpdateRegistry().
◆ AddCodepageToRegistry()
Definition at line 393 of file mui.c.
397{
403
404
406 L"SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage");
416 {
419 }
420
421
425 0,
430 {
434 }
435
436
440 0,
445 {
449 }
450
451
455 0,
460 {
464 }
465
467
469}
HANDLE GetRootKeyByPredefKey(IN HANDLE KeyHandle, OUT PCWSTR *RootKeyMountPoint OPTIONAL)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
#define HKEY_LOCAL_MACHINE
Referenced by AddCodePage().
◆ AddFontsSettingsToRegistry()
Definition at line 473 of file mui.c.
475{
482
484 L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes");
494 {
497 }
498
499 while (MuiSubFonts[uIndex].FontName !=
NULL)
500 {
502 if (MuiSubFonts[uIndex].SubFontName)
503 {
506 0,
508 (
PVOID)MuiSubFonts[uIndex].SubFontName,
509 (
wcslen(MuiSubFonts[uIndex].SubFontName)+1) *
sizeof(
WCHAR));
511 {
512 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %d)\n",
Status, uIndex);
515 }
516 }
517 else
518 {
521 {
523 }
524 }
525
526 uIndex++;
527 }
528
530
532}
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
Referenced by AddCodePage().
◆ AddHotkeySettings()
Definition at line 122 of file mui.c.
126{
133
135 L".DEFAULT\\Keyboard Layout\\Toggle");
141
145 0,
150 {
153 }
154
157
160 0,
163 (1 + 1) *
sizeof(
WCHAR));
165 {
169 }
170
173
176 0,
179 (1 + 1) *
sizeof(
WCHAR));
181 {
185 }
186
189
192 0,
195 (1 + 1) *
sizeof(
WCHAR));
197 {
201 }
202
205}
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
#define REG_OPTION_NON_VOLATILE
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
Referenced by AddKbLayoutsToRegistry().
◆ AddKbLayoutsToRegistry()
Definition at line 208 of file mui.c.
210{
220 WCHAR szKeyName[48] =
L".DEFAULT\\Keyboard Layout";
221 WCHAR szValueName[3 + 1];
222 WCHAR szLangID[8 + 1];
223
224
231
235 0,
240 {
243 }
244
246
247 KeyName.MaximumLength =
sizeof(szKeyName);
249
251 {
255 }
256
262
266 0,
271 {
274 }
275
282
286 0,
291 {
296 }
297
299 {
300 if (uIndex > 19) break;
301
304
306
307 if (
_wcsicmp(szLangID, MuiLayouts[uIndex].LayoutID) == 0)
308 {
311 0,
313 (
PVOID)MuiLayouts[uIndex].LayoutID,
314 (
wcslen(MuiLayouts[uIndex].LayoutID)+1) *
sizeof(
WCHAR));
316 {
317 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %d)\n",
Status, uIndex);
321 }
322 }
323 else
324 {
328 0,
333 {
334 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %d)\n",
Status, uIndex);
338 }
339
341
344 0,
346 (
PVOID)MuiLayouts[uIndex].LayoutID,
347 (
wcslen(MuiLayouts[uIndex].LayoutID)+1) *
sizeof(
WCHAR));
349 {
350 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %u)\n",
Status, uIndex);
354 }
355
356 uCount++;
357 }
358
359 uIndex++;
360 }
361
362 if (uIndex > 1)
364 else
366
370}
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
static BOOLEAN AddHotkeySettings(IN PCWSTR Hotkey, IN PCWSTR LangHotkey, IN PCWSTR LayoutHotkey)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING _Out_ PNDIS_HANDLE SubKeyHandle
#define KEY_CREATE_SUB_KEY
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Referenced by AddKeyboardLayouts(), and ProcessKeyboardLayoutRegistry().
◆ AddKeyboardLayouts()
Definition at line 373 of file mui.c.
375{
377
379 {
381 {
383 }
384
385 lngIndex++;
386 }
387
389}
BOOLEAN AddKbLayoutsToRegistry(IN const MUI_LAYOUTS *MuiLayouts)
Referenced by UpdateRegistry().
◆ FindLanguageIndex()
◆ IsLanguageAvailable()
◆ MUIDefaultKeyboardLayout()
Definition at line 88 of file mui.c.
90{
93}
static ULONG FindLanguageIndex(IN PCWSTR LanguageId)
const MUI_LAYOUTS * MuiLayouts
Referenced by UpdateKBLayout().
◆ MUIGetGeoID()
◆ MUIGetLayoutsList()
◆ MUIGetOEMCodePage()