Fix some keyboard layout related stuff in USetup.

svn path=/trunk/; revision=38169
This commit is contained in:
Dmitry Gorbachev 2008-12-18 12:26:47 +00:00
parent 35da2f5ea3
commit 32eb774e68
5 changed files with 26 additions and 12 deletions

View file

@ -3,9 +3,10 @@
MUI_LAYOUTS hyAMLayouts[] =
{
{ L"042b", L"0000042b" },
{ L"0409", L"00000409" },
{ L"042B", L"0000042B" },
{ L"042B", L"0001042B" },
{ L"0419", L"00000419" },
{ L"0409", L"00000409" },
{ NULL, NULL }
};

View file

@ -0,0 +1,11 @@
#ifndef LANG_MY_MM_H__
#define LANG_MY_MM_H__
MUI_LAYOUTS myMMLayouts[] =
{
{ L"0455", L"00000455" },
{ L"0409", L"00000409" },
{ NULL, NULL }
};
#endif

View file

@ -391,12 +391,12 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
{
if (uIndex > 19) break;
swprintf(szValueName, L"%d", uIndex + 1);
swprintf(szValueName, L"%u", uIndex + 1);
RtlInitUnicodeString(&ValueName, szValueName);
swprintf(szLangID, L"0000%s", MuiLayouts[uIndex].LangID);
if (wcscmp(szLangID, MuiLayouts[uIndex].LayoutID) == 0)
if (_wcsicmp(szLangID, MuiLayouts[uIndex].LayoutID) == 0)
{
Status = NtSetValueKey(KeyHandle,
&ValueName,
@ -414,7 +414,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
}
else
{
swprintf(szLangID, L"d%03d%s", uCount, MuiLayouts[uIndex].LangID);
swprintf(szLangID, L"d%03u%s", uCount, MuiLayouts[uIndex].LangID);
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
@ -439,7 +439,7 @@ AddKbLayoutsToRegistry(IN const MUI_LAYOUTS * MuiLayouts)
(wcslen(MuiLayouts[uIndex].LayoutID)+1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status = %lx, uIndex = %d)\n", Status, uIndex);
DPRINT1("NtSetValueKey() failed (Status = %lx, uIndex = %u)\n", Status, uIndex);
NtClose(SubKeyHandle);
NtClose(KeyHandle);
return FALSE;

View file

@ -99,6 +99,7 @@
#include "lang/mr-IN.h"
#include "lang/ms-BN.h"
#include "lang/ms-MY.h"
#include "lang/my-MM.h"
#include "lang/nl-BE.h"
#include "lang/nl-NL.h"
#include "lang/nn-NO.h"
@ -159,7 +160,7 @@ const MUI_LANGUAGE LanguageList[] =
{L"0000042D", L"1252", L"850", L"10000", L"Basque", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, euESLayouts },
{L"00000423", L"1251", L"866", L"10007", L"Belarusian", enUSPages, enUSErrorEntries, enUSStrings, CyrillicFonts, beBYLayouts },
{L"00000402", L"1251", L"866", L"10007", L"Bulgarian", bgBGPages, bgBGErrorEntries, bgBGStrings, CyrillicFonts, bgBGLayouts },
{L"00000455", L"0", L"1", L"2", L"Burmese", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, enUSLayouts },
{L"00000455", L"0", L"1", L"2", L"Burmese", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, myMMLayouts },
{L"00000403", L"1252", L"850", L"10000", L"Catalan", enUSPages, enUSErrorEntries, enUSStrings, LatinFonts, caESLayouts },
{L"00000404", L"950", L"950", L"10008", L"Chinese (Taiwan)", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhTWLayouts },
{L"00000804", L"936", L"936", L"10008", L"Chinese (PRC)", enUSPages, enUSErrorEntries, enUSStrings, UnicodeFonts, zhCNLayouts },

View file

@ -895,7 +895,7 @@ ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
PWCHAR LayoutId;
const MUI_LAYOUTS * LayoutsList;
MUI_LAYOUTS NewLayoutsList[20];
ULONG uIndex = 0;
ULONG uIndex;
ULONG uOldPos = 0;
Entry = GetCurrentListEntry(List);
@ -910,16 +910,17 @@ ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
if (_wcsicmp(LayoutsList[0].LayoutID, LayoutId) != 0)
{
do
for (uIndex = 1; LayoutsList[uIndex].LangID != NULL; uIndex++)
{
if (_wcsicmp(LayoutsList[uIndex].LayoutID, LayoutId) == 0)
{
uOldPos = uIndex;
continue;
}
uIndex++;
} while (LayoutsList[uIndex].LangID != NULL);
NewLayoutsList[uIndex].LangID = LayoutsList[uIndex].LangID;
NewLayoutsList[uIndex].LayoutID = LayoutsList[uIndex].LayoutID;
}
NewLayoutsList[uIndex].LangID = NULL;
NewLayoutsList[uIndex].LayoutID = NULL;