From 17c4299ff8ff20d198995bd72b3464a82741bee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 23 Feb 2024 17:28:59 +0100 Subject: [PATCH] ** WIP ** Improve handling of MUI/LANGID/... stuff This should fix part of CORE-11785 ** WIP ** Continue massaging the MUI stuff AND actually start to remove GENERIC_LIST from the settings. Some stuff to see: https://github.com/reactos/reactos/commits/7af2f717bc6ecb99c151193117d990c291bf08aa/base/setup/usetup/settings.c https://github.com/reactos/reactos/commit/8f2c4f7a6dfed20dc887471b20a40528653edfa2 etc. ** WIP ** Continue with refactoring the settings retrival and limiting usage of GENERIC_LIST. See commits: https://github.com/reactos/reactos/commit/829b0c63d9d756afcc395c00fea3d48145b8a8d1 https://github.com/reactos/reactos/commit/67880e735241f1e071ac6aa537bd1e0c1b3b3825 (for keyboard layout) and https://github.com/reactos/reactos/commit/e405ad257c0611d115f3fa7d82c9ca6cf00e6f75 (a commit of mine) --- base/setup/lib/install.c | 12 +- base/setup/lib/mui.c | 93 ++- base/setup/lib/mui.h | 24 +- base/setup/lib/muilanguages.h | 288 ++++---- base/setup/lib/settings.c | 1156 +++++++++++++++++++----------- base/setup/lib/settings.h | 117 ++- base/setup/lib/setuplib.c | 76 +- base/setup/lib/setuplib.h | 21 +- base/setup/reactos/reactos.c | 109 +-- base/setup/reactos/reactos.h | 13 +- base/setup/usetup/mui.c | 48 +- base/setup/usetup/mui.h | 11 +- base/setup/usetup/muilanguages.h | 288 ++++---- base/setup/usetup/usetup.c | 333 +++++---- base/setup/usetup/usetup.h | 8 +- boot/bootdata/txtsetup.sif | 6 +- 16 files changed, 1486 insertions(+), 1117 deletions(-) diff --git a/base/setup/lib/install.c b/base/setup/lib/install.c index 72f3ea92181..9ff579efba5 100644 --- a/base/setup/lib/install.c +++ b/base/setup/lib/install.c @@ -538,16 +538,8 @@ PrepareCopyInfFile( } /* Add specific files depending of computer type */ - { - PGENERIC_LIST_ENTRY Entry; - Entry = GetCurrentListEntry(pSetupData->ComputerList); - ASSERT(Entry); - pSetupData->ComputerType = ((PGENENTRY)GetListEntryData(Entry))->Id; - ASSERT(pSetupData->ComputerType); - if (!ProcessComputerFiles(InfFile, pSetupData->ComputerType, &AdditionalSectionName)) return FALSE; - } if (AdditionalSectionName && !AddSectionToCopyQueue(pSetupData, InfFile, @@ -769,7 +761,7 @@ PrepareFileCopy( InfFileSize, NULL, INF_STYLE_WIN4, - pSetupData->LanguageId, + LANGIDFROMLCID(pSetupData->LocaleID), &ErrorLine); CabinetCleanup(&CabinetContext); @@ -792,7 +784,7 @@ PrepareFileCopy( InfHandle = SpInfOpenInfFile(PathBuffer, NULL, INF_STYLE_WIN4, - pSetupData->LanguageId, + LANGIDFROMLCID(pSetupData->LocaleID), &ErrorLine); } #endif diff --git a/base/setup/lib/mui.c b/base/setup/lib/mui.c index 48af986e908..7523b782ae3 100644 --- a/base/setup/lib/mui.c +++ b/base/setup/lib/mui.c @@ -42,25 +42,22 @@ static ULONG FindLanguageIndex( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = 0; - if (LanguageId == NULL) + if (LanguageId == 0) { /* Default to en-US */ - // return 0; // FIXME!! - LanguageId = L"00000409"; + // return 0; // FIXME!! + LanguageId = 0x0409; } - while (MUILanguageList[lngIndex].LanguageID != NULL) + while (MUILanguageList[lngIndex].LanguageID != 0) { - if (_wcsicmp(MUILanguageList[lngIndex].LanguageID, LanguageId) == 0) - { + if (MUILanguageList[lngIndex].LanguageID == LanguageId) return lngIndex; - } - - lngIndex++; + ++lngIndex; } return 0; @@ -68,16 +65,15 @@ FindLanguageIndex( BOOLEAN IsLanguageAvailable( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = 0; - while (MUILanguageList[lngIndex].LanguageID != NULL) + while (MUILanguageList[lngIndex].LanguageID != 0) { - if (_wcsicmp(MUILanguageList[lngIndex].LanguageID, LanguageId) == 0) + if (MUILanguageList[lngIndex].LanguageID == LanguageId) return TRUE; - - lngIndex++; + ++lngIndex; } return FALSE; @@ -86,7 +82,7 @@ IsLanguageAvailable( KLID MUIDefaultKeyboardLayout( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = FindLanguageIndex(LanguageId); return MUILanguageList[lngIndex].MuiLayouts[0].LayoutID; @@ -94,7 +90,7 @@ MUIDefaultKeyboardLayout( UINT MUIGetOEMCodePage( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = FindLanguageIndex(LanguageId); return MUILanguageList[lngIndex].OEMCPage; @@ -102,7 +98,7 @@ MUIGetOEMCodePage( GEOID MUIGetGeoID( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = FindLanguageIndex(LanguageId); return MUILanguageList[lngIndex].GeoID; @@ -110,7 +106,7 @@ MUIGetGeoID( const MUI_LAYOUTS* MUIGetLayoutsList( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = FindLanguageIndex(LanguageId); return MUILanguageList[lngIndex].MuiLayouts; @@ -125,16 +121,14 @@ AddHotkeySettings( IN PCWSTR LayoutHotkey) { OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING KeyName; - UNICODE_STRING ValueName; + UNICODE_STRING Name; HANDLE KeyHandle; ULONG Disposition; NTSTATUS Status; - RtlInitUnicodeString(&KeyName, - L".DEFAULT\\Keyboard Layout\\Toggle"); + RtlInitUnicodeString(&Name, L".DEFAULT\\Keyboard Layout\\Toggle"); InitializeObjectAttributes(&ObjectAttributes, - &KeyName, + &Name, OBJ_CASE_INSENSITIVE, GetRootKeyByPredefKey(HKEY_USERS, NULL), NULL); @@ -152,11 +146,9 @@ AddHotkeySettings( return FALSE; } - RtlInitUnicodeString(&ValueName, - L"Hotkey"); - + RtlInitUnicodeString(&Name, L"Hotkey"); Status = NtSetValueKey(KeyHandle, - &ValueName, + &Name, 0, REG_SZ, (PVOID)Hotkey, @@ -168,11 +160,9 @@ AddHotkeySettings( return FALSE; } - RtlInitUnicodeString(&ValueName, - L"Language Hotkey"); - + RtlInitUnicodeString(&Name, L"Language Hotkey"); Status = NtSetValueKey(KeyHandle, - &ValueName, + &Name, 0, REG_SZ, (PVOID)LangHotkey, @@ -184,11 +174,9 @@ AddHotkeySettings( return FALSE; } - RtlInitUnicodeString(&ValueName, - L"Layout Hotkey"); - + RtlInitUnicodeString(&Name, L"Layout Hotkey"); Status = NtSetValueKey(KeyHandle, - &ValueName, + &Name, 0, REG_SZ, (PVOID)LayoutHotkey, @@ -289,7 +277,9 @@ AddKbLayoutsToRegistry( if (!NT_SUCCESS(Status)) { DPRINT1("NtCreateKey() failed (Status %lx)\n", Status); - goto Quit; + // goto Quit; + NtClose(KeyHandle); + return FALSE; } uCount = 0; @@ -360,18 +350,15 @@ Quit: BOOLEAN AddKeyboardLayouts( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = 0; - while (MUILanguageList[lngIndex].LanguageID != NULL) + while (MUILanguageList[lngIndex].LanguageID != 0) { - if (_wcsicmp(MUILanguageList[lngIndex].LanguageID, LanguageId) == 0) - { + if (MUILanguageList[lngIndex].LanguageID == LanguageId) return AddKbLayoutsToRegistry(MUILanguageList[lngIndex].MuiLayouts); - } - - lngIndex++; + ++lngIndex; } return FALSE; @@ -407,7 +394,7 @@ AddCodepageToRegistry( &ObjectAttributes); if (!NT_SUCCESS(Status)) { - DPRINT1("NtOpenKey() failed (Status %lx)\n", Status); + DPRINT1("NtOpenKey(\"%wZ\") failed (Status %lx)\n", &Name, Status); return FALSE; } @@ -424,7 +411,7 @@ AddCodepageToRegistry( (wcslen(Value)+1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { - DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); + DPRINT1("NtSetValueKey(\"%wZ\") failed (Status %lx)\n", &Name, Status); goto Quit; } @@ -441,7 +428,7 @@ AddCodepageToRegistry( (wcslen(Value)+1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { - DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); + DPRINT1("NtSetValueKey(\"%wZ\") failed (Status %lx)\n", &Name, Status); goto Quit; } @@ -458,7 +445,7 @@ AddCodepageToRegistry( (wcslen(Value)+1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { - DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); + DPRINT1("NtSetValueKey(\"%wZ\") failed (Status %lx)\n", &Name, Status); goto Quit; } @@ -508,7 +495,7 @@ AddFontsSettingsToRegistry( (wcslen(MuiSubFonts[uIndex].SubFontName)+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(KeyHandle); return FALSE; } @@ -532,13 +519,13 @@ AddFontsSettingsToRegistry( BOOLEAN AddCodePage( - IN PCWSTR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = 0; - while (MUILanguageList[lngIndex].LanguageID != NULL) + while (MUILanguageList[lngIndex].LanguageID != 0) { - if (_wcsicmp(MUILanguageList[lngIndex].LanguageID, LanguageId) == 0) + if (MUILanguageList[lngIndex].LanguageID == LanguageId) { if (AddCodepageToRegistry(MUILanguageList[lngIndex].ACPage, MUILanguageList[lngIndex].OEMCPage, @@ -553,7 +540,7 @@ AddCodePage( } } - lngIndex++; + ++lngIndex; } return FALSE; diff --git a/base/setup/lib/mui.h b/base/setup/lib/mui.h index 219f69e551a..60d041fb238 100644 --- a/base/setup/lib/mui.h +++ b/base/setup/lib/mui.h @@ -1,5 +1,11 @@ #pragma once +/* + * See the intl.inf file map: + * + * ; List of locales. + * ; = , + */ typedef struct { PCWSTR FontName; @@ -7,6 +13,8 @@ typedef struct } MUI_SUBFONT; typedef USHORT LANGID; +// #define MAXUSHORT USHRT_MAX +// typedef DWORD LCID; typedef ULONG KLID; /* @@ -29,7 +37,7 @@ typedef ULONG GEOID; // See winnls.h typedef struct { - PCWSTR LanguageID; + LCID LanguageID; // LocaleID; UINT ACPage; UINT OEMCPage; UINT MACCPage; @@ -42,23 +50,23 @@ typedef struct BOOLEAN IsLanguageAvailable( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); KLID MUIDefaultKeyboardLayout( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); UINT MUIGetOEMCodePage( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); GEOID MUIGetGeoID( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); const MUI_LAYOUTS* MUIGetLayoutsList( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); BOOLEAN AddKbLayoutsToRegistry( @@ -66,8 +74,8 @@ AddKbLayoutsToRegistry( BOOLEAN AddKeyboardLayouts( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); BOOLEAN AddCodePage( - IN PCWSTR LanguageId); + _In_ LANGID LanguageId); diff --git a/base/setup/lib/muilanguages.h b/base/setup/lib/muilanguages.h index 636c8468f34..2f212f998fa 100644 --- a/base/setup/lib/muilanguages.h +++ b/base/setup/lib/muilanguages.h @@ -411,432 +411,432 @@ const MUI_LANGUAGE MUILanguageList[] = { - /* Lang ID, ANSI CP, OEM CP, MAC CP, Language Name, GeoID, Fonts, KB Layouts */ + /* LangID, ANSI CP, OEM CP, MAC CP, Language Name, GeoID, Fonts, KB Layouts */ #ifdef LANGUAGE_AF_ZA - {L"00000436", 1252, 850, 10000, L"Afrikaans", 209, LatinFonts, afZALayouts}, + {0x00000436, 1252, 850, 10000, L"Afrikaans", 209, LatinFonts, afZALayouts}, #endif #ifdef LANGUAGE_SQ_AL - {L"0000041C", 1250, 852, 10029, L"Albanian (Albania)", 6, LatinFonts, sqALLayouts}, + {0x0000041C, 1250, 852, 10029, L"Albanian (Albania)", 6, LatinFonts, sqALLayouts}, #endif #ifdef LANGUAGE_AR_SA - {L"00000401", 1256, 720, 10004, L"Arabic (Saudi Arabia)", 205, UnicodeFonts, arSALayouts}, + {0x00000401, 1256, 720, 10004, L"Arabic (Saudi Arabia)", 205, UnicodeFonts, arSALayouts}, #endif #ifdef LANGUAGE_AR_IQ - {L"00000801", 1256, 720, 10004, L"Arabic (Iraq)", 121, UnicodeFonts, arIQLayouts}, + {0x00000801, 1256, 720, 10004, L"Arabic (Iraq)", 121, UnicodeFonts, arIQLayouts}, #endif #ifdef LANGUAGE_AR_EG - {L"00000C01", 1256, 720, 10004, L"Arabic (Egypt)", 67, UnicodeFonts, arEGLayouts}, + {0x00000C01, 1256, 720, 10004, L"Arabic (Egypt)", 67, UnicodeFonts, arEGLayouts}, #endif #ifdef LANGUAGE_AR_LY - {L"00001001", 1256, 720, 10004, L"Arabic (Libya)", 148, UnicodeFonts, arLYLayouts}, + {0x00001001, 1256, 720, 10004, L"Arabic (Libya)", 148, UnicodeFonts, arLYLayouts}, #endif #ifdef LANGUAGE_AR_DZ - {L"00001401", 1256, 720, 10004, L"Arabic (Algeria)", 4, UnicodeFonts, arDZLayouts}, + {0x00001401, 1256, 720, 10004, L"Arabic (Algeria)", 4, UnicodeFonts, arDZLayouts}, #endif #ifdef LANGUAGE_AR_MA - {L"00001801", 1256, 720, 10004, L"Arabic (Morocco)", 149, UnicodeFonts, arMALayouts}, + {0x00001801, 1256, 720, 10004, L"Arabic (Morocco)", 149, UnicodeFonts, arMALayouts}, #endif #ifdef LANGUAGE_AR_TN - {L"00001C01", 1256, 720, 10004, L"Arabic (Tunisia)", 234, UnicodeFonts, arTNLayouts}, + {0x00001C01, 1256, 720, 10004, L"Arabic (Tunisia)", 234, UnicodeFonts, arTNLayouts}, #endif #ifdef LANGUAGE_AR_OM - {L"00002001", 1256, 720, 10004, L"Arabic (Oman)", 164, UnicodeFonts, arOMLayouts}, + {0x00002001, 1256, 720, 10004, L"Arabic (Oman)", 164, UnicodeFonts, arOMLayouts}, #endif #ifdef LANGUAGE_AR_YE - {L"00002401", 1256, 720, 10004, L"Arabic (Yemen)", 261, UnicodeFonts, arYELayouts}, + {0x00002401, 1256, 720, 10004, L"Arabic (Yemen)", 261, UnicodeFonts, arYELayouts}, #endif #ifdef LANGUAGE_AR_SY - {L"00002801", 1256, 720, 10004, L"Arabic (Syria)", 222, UnicodeFonts, arSYLayouts}, + {0x00002801, 1256, 720, 10004, L"Arabic (Syria)", 222, UnicodeFonts, arSYLayouts}, #endif #ifdef LANGUAGE_AR_JO - {L"00002C01", 1256, 720, 10004, L"Arabic (Jordan)", 126, UnicodeFonts, arJOLayouts}, + {0x00002C01, 1256, 720, 10004, L"Arabic (Jordan)", 126, UnicodeFonts, arJOLayouts}, #endif #ifdef LANGUAGE_AR_LB - {L"00003001", 1256, 720, 10004, L"Arabic (Lebanon)", 139, UnicodeFonts, arLBLayouts}, + {0x00003001, 1256, 720, 10004, L"Arabic (Lebanon)", 139, UnicodeFonts, arLBLayouts}, #endif #ifdef LANGUAGE_AR_KW - {L"00003401", 1256, 720, 10004, L"Arabic (Kuwait)", 136, UnicodeFonts, arKWLayouts}, + {0x00003401, 1256, 720, 10004, L"Arabic (Kuwait)", 136, UnicodeFonts, arKWLayouts}, #endif #ifdef LANGUAGE_AR_AE - {L"00003801", 1256, 720, 10004, L"Arabic (U.A.E.)", 224, UnicodeFonts, arAELayouts}, + {0x00003801, 1256, 720, 10004, L"Arabic (U.A.E.)", 224, UnicodeFonts, arAELayouts}, #endif #ifdef LANGUAGE_AR_BH - {L"00003C01", 1256, 720, 10004, L"Arabic (Bahrain)", 17, UnicodeFonts, arBHLayouts}, + {0x00003C01, 1256, 720, 10004, L"Arabic (Bahrain)", 17, UnicodeFonts, arBHLayouts}, #endif #ifdef LANGUAGE_AR_QA - {L"00004001", 1256, 720, 10004, L"Arabic (Qatar)", 197, UnicodeFonts, arQALayouts}, + {0x00004001, 1256, 720, 10004, L"Arabic (Qatar)", 197, UnicodeFonts, arQALayouts}, #endif #ifdef LANGUAGE_HY_AM - {L"0000042B", 0, 1, 2, L"Armenian", 7, UnicodeFonts, hyAMLayouts}, + {0x0000042B, 0, 1, 2, L"Armenian", 7, UnicodeFonts, hyAMLayouts}, #endif #ifdef LANGUAGE_AZ_AZ - {L"0000082C", 1251, 866, 10007, L"Azeri (Cyrillic)", 5, CyrillicFonts, azAZLayouts}, + {0x0000082C, 1251, 866, 10007, L"Azeri (Cyrillic)", 5, CyrillicFonts, azAZLayouts}, #endif #ifdef LANGUAGE_AZ_AZ - {L"0000042C", 1254, 857, 10081, L"Azeri (Latin)", 5, LatinFonts, azAZLayouts}, + {0x0000042C, 1254, 857, 10081, L"Azeri (Latin)", 5, LatinFonts, azAZLayouts}, #endif #ifdef LANGUAGE_EU_ES - {L"0000042D", 1252, 850, 10000, L"Basque", 217, LatinFonts, euESLayouts}, + {0x0000042D, 1252, 850, 10000, L"Basque", 217, LatinFonts, euESLayouts}, #endif #ifdef LANGUAGE_BE_BY - {L"00000423", 1251, 866, 10007, L"Belarusian", 29, CyrillicFonts, beBYLayouts}, + {0x00000423, 1251, 866, 10007, L"Belarusian", 29, CyrillicFonts, beBYLayouts}, #endif #ifdef LANGUAGE_BN_BD - {L"00000845", 0, 1, 2, L"Bengali (Bangladesh)", 23, UnicodeFonts, bnBDLayouts}, + {0x00000845, 0, 1, 2, L"Bengali (Bangladesh)", 23, UnicodeFonts, bnBDLayouts}, #endif #ifdef LANGUAGE_BN_IN - {L"00000445", 0, 1, 2, L"Bengali (India)", 113, UnicodeFonts, bnINLayouts}, + {0x00000445, 0, 1, 2, L"Bengali (India)", 113, UnicodeFonts, bnINLayouts}, #endif #ifdef LANGUAGE_BG_BG - {L"00000402", 1251, 866, 10007, L"Bulgarian", 35, CyrillicFonts, bgBGLayouts}, + {0x00000402, 1251, 866, 10007, L"Bulgarian", 35, CyrillicFonts, bgBGLayouts}, #endif #ifdef LANGUAGE_MY_MM - {L"00000455", 0, 1, 2, L"Burmese", 1, UnicodeFonts, myMMLayouts}, + {0x00000455, 0, 1, 2, L"Burmese", 1, UnicodeFonts, myMMLayouts}, #endif #ifdef LANGUAGE_CA_ES - {L"00000403", 1252, 850, 10000, L"Catalan", 217, LatinFonts, caESLayouts}, + {0x00000403, 1252, 850, 10000, L"Catalan", 217, LatinFonts, caESLayouts}, #endif #ifdef LANGUAGE_ZH_TW - {L"00000404", 950, 950, 10008, L"Chinese (Taiwan)", 237, ChineseTraditionalFonts, zhTWLayouts}, + {0x00000404, 950, 950, 10008, L"Chinese (Taiwan)", 237, ChineseTraditionalFonts, zhTWLayouts}, #endif #ifdef LANGUAGE_ZH_CN - {L"00000804", 936, 936, 10008, L"Chinese (PRC)", 45, ChineseSimplifiedFonts, zhCNLayouts}, + {0x00000804, 936, 936, 10008, L"Chinese (PRC)", 45, ChineseSimplifiedFonts, zhCNLayouts}, #endif #ifdef LANGUAGE_ZH_HK - {L"00000C04", 950, 950, 10008, L"Chinese (Hong Kong S.A.R.)", 104, ChineseTraditionalFonts, zhHKLayouts}, + {0x00000C04, 950, 950, 10008, L"Chinese (Hong Kong S.A.R.)", 104, ChineseTraditionalFonts, zhHKLayouts}, #endif #ifdef LANGUAGE_ZH_SG - {L"00001004", 936, 936, 10008, L"Chinese (Singapore)", 215, ChineseSimplifiedFonts, zhSGLayouts}, + {0x00001004, 936, 936, 10008, L"Chinese (Singapore)", 215, ChineseSimplifiedFonts, zhSGLayouts}, #endif #ifdef LANGUAGE_ZH_MO - {L"00001404", 950, 950, 10002, L"Chinese (Macau S.A.R.)", 151, ChineseTraditionalFonts, zhMOLayouts}, + {0x00001404, 950, 950, 10002, L"Chinese (Macau S.A.R.)", 151, ChineseTraditionalFonts, zhMOLayouts}, #endif #ifdef LANGUAGE_HR_HR - {L"0000041A", 1250, 852, 10029, L"Croatian", 108, LatinFonts, hrHRLayouts}, + {0x0000041A, 1250, 852, 10029, L"Croatian", 108, LatinFonts, hrHRLayouts}, #endif #ifdef LANGUAGE_CS_CZ - {L"00000405", 1250, 852, 10029, L"Czech", 75, LatinFonts, csCZLayouts}, + {0x00000405, 1250, 852, 10029, L"Czech", 75, LatinFonts, csCZLayouts}, #endif #ifdef LANGUAGE_DA_DK - {L"00000406", 1252, 850, 10000, L"Danish", 61, LatinFonts, daDKLayouts}, + {0x00000406, 1252, 850, 10000, L"Danish", 61, LatinFonts, daDKLayouts}, #endif #ifdef LANGUAGE_DV_MV - {L"00000465", 0, 1, 2, L"Dhivehi (Maldives)", 165, UnicodeFonts, dvMVLayouts}, + {0x00000465, 0, 1, 2, L"Dhivehi (Maldives)", 165, UnicodeFonts, dvMVLayouts}, #endif #ifdef LANGUAGE_NL_NL - {L"00000413", 1252, 850, 10000, L"Dutch (Netherlands)", 176, LatinFonts, nlNLLayouts}, + {0x00000413, 1252, 850, 10000, L"Dutch (Netherlands)", 176, LatinFonts, nlNLLayouts}, #endif #ifdef LANGUAGE_NL_BE - {L"00000813", 1252, 850, 10000, L"Dutch (Belgium)", 21, LatinFonts, nlBELayouts}, + {0x00000813, 1252, 850, 10000, L"Dutch (Belgium)", 21, LatinFonts, nlBELayouts}, #endif #ifdef LANGUAGE_EN_US - {L"00000409", 1252, 437, 10000, L"English (United States)", 244, LatinFonts, enUSLayouts}, + {0x00000409, 1252, 437, 10000, L"English (United States)", 244, LatinFonts, enUSLayouts}, #endif #ifdef LANGUAGE_EN_GB - {L"00000809", 1252, 850, 10000, L"English (United Kingdom)", 242, LatinFonts, enGBLayouts}, + {0x00000809, 1252, 850, 10000, L"English (United Kingdom)", 242, LatinFonts, enGBLayouts}, #endif #ifdef LANGUAGE_EN_AU - {L"00000C09", 1252, 850, 10000, L"English (Australia)", 12, LatinFonts, enAULayouts}, + {0x00000C09, 1252, 850, 10000, L"English (Australia)", 12, LatinFonts, enAULayouts}, #endif #ifdef LANGUAGE_EN_CA - {L"00001009", 1252, 850, 10000, L"English (Canada)", 39, LatinFonts, enCALayouts}, + {0x00001009, 1252, 850, 10000, L"English (Canada)", 39, LatinFonts, enCALayouts}, #endif #ifdef LANGUAGE_EN_NZ - {L"00001409", 1252, 850, 10000, L"English (New Zealand)", 183, LatinFonts, enNZLayouts}, + {0x00001409, 1252, 850, 10000, L"English (New Zealand)", 183, LatinFonts, enNZLayouts}, #endif #ifdef LANGUAGE_EN_IE - {L"00001809", 1252, 850, 10000, L"English (Ireland)", 68, LatinFonts, enIELayouts}, + {0x00001809, 1252, 850, 10000, L"English (Ireland)", 68, LatinFonts, enIELayouts}, #endif #ifdef LANGUAGE_EN_ZA - {L"00001C09", 1252, 437, 10000, L"English (South Africa)", 209, LatinFonts, enZALayouts}, + {0x00001C09, 1252, 437, 10000, L"English (South Africa)", 209, LatinFonts, enZALayouts}, #endif #ifdef LANGUAGE_EN_JM - {L"00002009", 1252, 850, 10000, L"English (Jamaica)", 124, LatinFonts, enJMLayouts}, + {0x00002009, 1252, 850, 10000, L"English (Jamaica)", 124, LatinFonts, enJMLayouts}, #endif #ifdef LANGUAGE_EN_CB - {L"00002409", 1252, 850, 10000, L"English (Caribbean)", 1, LatinFonts, enCBLayouts}, + {0x00002409, 1252, 850, 10000, L"English (Caribbean)", 1, LatinFonts, enCBLayouts}, #endif #ifdef LANGUAGE_EN_BZ - {L"00002809", 1252, 850, 10000, L"English (Belize)", 24, LatinFonts, enBZLayouts}, + {0x00002809, 1252, 850, 10000, L"English (Belize)", 24, LatinFonts, enBZLayouts}, #endif #ifdef LANGUAGE_EN_TT - {L"00002C09", 1252, 850, 10000, L"English (Trinidad)", 225, LatinFonts, enTTLayouts}, + {0x00002C09, 1252, 850, 10000, L"English (Trinidad)", 225, LatinFonts, enTTLayouts}, #endif #ifdef LANGUAGE_EN_ZW - {L"00003009", 1252, 437, 10000, L"English (Zimbabwe)", 264, LatinFonts, enZWLayouts}, + {0x00003009, 1252, 437, 10000, L"English (Zimbabwe)", 264, LatinFonts, enZWLayouts}, #endif #ifdef LANGUAGE_EN_PH - {L"00003409", 1252, 437, 10000, L"English (Philippines)", 201, LatinFonts, enPHLayouts}, + {0x00003409, 1252, 437, 10000, L"English (Philippines)", 201, LatinFonts, enPHLayouts}, #endif #ifdef LANGUAGE_EO_AA - {L"0000048F", 1252, 437, 10000, L"Esperanto", 1, LatinFonts, eoAALayouts}, + {0x0000048F, 1252, 437, 10000, L"Esperanto", 1, LatinFonts, eoAALayouts}, #endif #ifdef LANGUAGE_ET_EE - {L"00000425", 1252, 775, 10029, L"Estonian", 70, LatinFonts, etEELayouts}, + {0x00000425, 1252, 775, 10029, L"Estonian", 70, LatinFonts, etEELayouts}, #endif #ifdef LANGUAGE_FO_FO - {L"00000438", 1252, 850, 10079, L"Faeroese", 81, LatinFonts, foFOLayouts}, + {0x00000438, 1252, 850, 10079, L"Faeroese", 81, LatinFonts, foFOLayouts}, #endif #ifdef LANGUAGE_FA_IR - {L"00000429", 1256, 720, 10004, L"Farsi", 116, UnicodeFonts, faIRLayouts}, + {0x00000429, 1256, 720, 10004, L"Farsi", 116, UnicodeFonts, faIRLayouts}, #endif #ifdef LANGUAGE_FI_FI - {L"0000040B", 1252, 850, 10000, L"Finnish", 77, LatinFonts, fiFILayouts}, + {0x0000040B, 1252, 850, 10000, L"Finnish", 77, LatinFonts, fiFILayouts}, #endif #ifdef LANGUAGE_FR_CA - {L"00000C0C", 1252, 850, 10000, L"French (Canada)", 39, LatinFonts, frCALayouts}, + {0x00000C0C, 1252, 850, 10000, L"French (Canada)", 39, LatinFonts, frCALayouts}, #endif #ifdef LANGUAGE_FR_FR - {L"0000040C", 1252, 850, 10000, L"French (France)", 84, LatinFonts, frFRLayouts}, + {0x0000040C, 1252, 850, 10000, L"French (France)", 84, LatinFonts, frFRLayouts}, #endif #ifdef LANGUAGE_FR_BE - {L"0000080C", 1252, 850, 10000, L"French (Belgium)", 21, LatinFonts, frBELayouts}, + {0x0000080C, 1252, 850, 10000, L"French (Belgium)", 21, LatinFonts, frBELayouts}, #endif #ifdef LANGUAGE_FR_CH - {L"0000100C", 1252, 850, 10000, L"French (Switzerland)", 223, LatinFonts, frCHLayouts}, + {0x0000100C, 1252, 850, 10000, L"French (Switzerland)", 223, LatinFonts, frCHLayouts}, #endif #ifdef LANGUAGE_FR_LU - {L"0000140C", 1252, 850, 10000, L"French (Luxembourg)", 147, LatinFonts, frLULayouts}, + {0x0000140C, 1252, 850, 10000, L"French (Luxembourg)", 147, LatinFonts, frLULayouts}, #endif #ifdef LANGUAGE_FR_MC - {L"0000180C", 1252, 850, 10000, L"French (Monaco)", 158, LatinFonts, frMCLayouts}, + {0x0000180C, 1252, 850, 10000, L"French (Monaco)", 158, LatinFonts, frMCLayouts}, #endif #ifdef LANGUAGE_GL_ES - {L"00000456", 1252, 850, 10000, L"Galician (Spain)", 217, LatinFonts, glESLayouts}, + {0x00000456, 1252, 850, 10000, L"Galician (Spain)", 217, LatinFonts, glESLayouts}, #endif #ifdef LANGUAGE_KA_GE - {L"00000437", 0, 1, 2, L"Georgian", 88, UnicodeFonts, kaGELayouts}, + {0x00000437, 0, 1, 2, L"Georgian", 88, UnicodeFonts, kaGELayouts}, #endif #ifdef LANGUAGE_DE_DE - {L"00000407", 1252, 850, 10000, L"German (Germany)", 94, LatinFonts, deDELayouts}, + {0x00000407, 1252, 850, 10000, L"German (Germany)", 94, LatinFonts, deDELayouts}, #endif #ifdef LANGUAGE_DE_CH - {L"00000807", 1252, 850, 10000, L"German (Switzerland)", 223, LatinFonts, deCHLayouts}, + {0x00000807, 1252, 850, 10000, L"German (Switzerland)", 223, LatinFonts, deCHLayouts}, #endif #ifdef LANGUAGE_DE_AT - {L"00000C07", 1252, 850, 10000, L"German (Austria)", 14, LatinFonts, deATLayouts}, + {0x00000C07, 1252, 850, 10000, L"German (Austria)", 14, LatinFonts, deATLayouts}, #endif #ifdef LANGUAGE_DE_LU - {L"00001007", 1252, 850, 10000, L"German (Luxembourg)", 147, LatinFonts, deLULayouts}, + {0x00001007, 1252, 850, 10000, L"German (Luxembourg)", 147, LatinFonts, deLULayouts}, #endif #ifdef LANGUAGE_DE_LI - {L"00001407", 1252, 850, 10000, L"German (Liechtenstein)", 145, LatinFonts, deLILayouts}, + {0x00001407, 1252, 850, 10000, L"German (Liechtenstein)", 145, LatinFonts, deLILayouts}, #endif #ifdef LANGUAGE_EL_GR - {L"00000408", 1253, 737, 10006, L"Greek", 98, GreekFonts, elGRLayouts}, + {0x00000408, 1253, 737, 10006, L"Greek", 98, GreekFonts, elGRLayouts}, #endif #ifdef LANGUAGE_GU_IN - {L"00000447", 0, 1, 2, L"Gujarati (India)", 113, UnicodeFonts, guINLayouts}, + {0x00000447, 0, 1, 2, L"Gujarati (India)", 113, UnicodeFonts, guINLayouts}, #endif #ifdef LANGUAGE_HE_IL - {L"0000040D", 1255, 862, 10005, L"Hebrew", 117, HebrewFonts, heILLayouts}, + {0x0000040D, 1255, 862, 10005, L"Hebrew", 117, HebrewFonts, heILLayouts}, #endif #ifdef LANGUAGE_HI_IN - {L"00000439", 1252, 437, 10000, L"Hindi", 113, HindiFonts, hiINLayouts }, + {0x00000439, 1252, 437, 10000, L"Hindi", 113, HindiFonts, hiINLayouts }, #endif #ifdef LANGUAGE_HU_HU - {L"0000040E", 1250, 852, 10029, L"Hungarian", 109, LatinFonts, huHULayouts}, + {0x0000040E, 1250, 852, 10029, L"Hungarian", 109, LatinFonts, huHULayouts}, #endif #ifdef LANGUAGE_IS_IS - {L"0000040F", 1252, 850, 10079, L"Icelandic", 110, LatinFonts, isISLayouts}, + {0x0000040F, 1252, 850, 10079, L"Icelandic", 110, LatinFonts, isISLayouts}, #endif #ifdef LANGUAGE_ID_ID - {L"00000421", 1252, 850, 10079, L"Indonesian", 111, LatinFonts, idIDLayouts}, + {0x00000421, 1252, 850, 10079, L"Indonesian", 111, LatinFonts, idIDLayouts}, #endif #ifdef LANGUAGE_IT_IT - {L"00000410", 1252, 850, 10000, L"Italian (Italy)", 118, LatinFonts, itITLayouts}, + {0x00000410, 1252, 850, 10000, L"Italian (Italy)", 118, LatinFonts, itITLayouts}, #endif #ifdef LANGUAGE_IT_CH - {L"00000810", 1252, 850, 10000, L"Italian (Switzerland)", 223, LatinFonts, itCHLayouts}, + {0x00000810, 1252, 850, 10000, L"Italian (Switzerland)", 223, LatinFonts, itCHLayouts}, #endif #ifdef LANGUAGE_JA_JP - {L"00000411", 932, 932, 10001, L"Japanese", 122, JapaneseFonts, jaJPLayouts}, + {0x00000411, 932, 932, 10001, L"Japanese", 122, JapaneseFonts, jaJPLayouts}, #endif #ifdef LANGUAGE_KN_IN - {L"0000044B", 1252, 437, 10079, L"Kannada (India)", 113, LatinFonts, knINLayouts}, + {0x0000044B, 1252, 437, 10079, L"Kannada (India)", 113, LatinFonts, knINLayouts}, #endif #ifdef LANGUAGE_KK_KZ - {L"0000043F", 1251, 866, 10007, L"Kazakh", 137, CyrillicFonts, kkKZLayouts}, + {0x0000043F, 1251, 866, 10007, L"Kazakh", 137, CyrillicFonts, kkKZLayouts}, #endif #ifdef LANGUAGE_KOK_IN - {L"00000457", 0, 437, 2, L"Konkani", 113, UnicodeFonts, kokINLayouts}, + {0x00000457, 0, 437, 2, L"Konkani", 113, UnicodeFonts, kokINLayouts}, #endif #ifdef LANGUAGE_KO_KR - {L"00000412", 949, 949, 10003, L"Korean", 134, KoreanFonts, koKRLayouts}, + {0x00000412, 949, 949, 10003, L"Korean", 134, KoreanFonts, koKRLayouts}, #endif #ifdef LANGUAGE_KY_KG - {L"00000440", 1251, 866, 10007, L"Kyrgyz (Kyrgyzstan)", 130, CyrillicFonts, kyKGLayouts}, + {0x00000440, 1251, 866, 10007, L"Kyrgyz (Kyrgyzstan)", 130, CyrillicFonts, kyKGLayouts}, #endif #ifdef LANGUAGE_LV_LV - {L"00000426", 1257, 775, 10029, L"Latvian", 140, LatinFonts, lvLVLayouts}, + {0x00000426, 1257, 775, 10029, L"Latvian", 140, LatinFonts, lvLVLayouts}, #endif #ifdef LANGUAGE_LT_LT - {L"00000427", 1257, 775, 10029, L"Lithuanian", 141, LatinFonts, ltLTLayouts}, + {0x00000427, 1257, 775, 10029, L"Lithuanian", 141, LatinFonts, ltLTLayouts}, #endif #ifdef LANGUAGE_MK_MK - {L"0000042F", 1251, 866, 10007, L"FYRO Macedonian", 19618, CyrillicFonts, mkMKLayouts}, + {0x0000042F, 1251, 866, 10007, L"FYRO Macedonian", 19618, CyrillicFonts, mkMKLayouts}, #endif #ifdef LANGUAGE_MS_BN - {L"0000083E", 1252, 850, 10000, L"Malay (Brunei Darussalam)", 37, LatinFonts, msBNLayouts}, + {0x0000083E, 1252, 850, 10000, L"Malay (Brunei Darussalam)", 37, LatinFonts, msBNLayouts}, #endif #ifdef LANGUAGE_MS_MY - {L"0000043E", 1252, 850, 10000, L"Malay (Malaysia)", 167, LatinFonts, msMYLayouts}, + {0x0000043E, 1252, 850, 10000, L"Malay (Malaysia)", 167, LatinFonts, msMYLayouts}, #endif #ifdef LANGUAGE_MR_IN - {L"0000044E", 0, 1, 2, L"Marathi", 113, UnicodeFonts, mrINLayouts}, + {0x0000044E, 0, 1, 2, L"Marathi", 113, UnicodeFonts, mrINLayouts}, #endif #ifdef LANGUAGE_MN_MN - {L"00000450", 1251, 866, 10007, L"Mongolian (Mongolia)", 154, CyrillicFonts, mnMNLayouts}, + {0x00000450, 1251, 866, 10007, L"Mongolian (Mongolia)", 154, CyrillicFonts, mnMNLayouts}, #endif #ifdef LANGUAGE_NB_NO - {L"00000414", 1252, 850, 10000, L"Norwegian (Bokmal)", 177, LatinFonts, nbNOLayouts}, + {0x00000414, 1252, 850, 10000, L"Norwegian (Bokmal)", 177, LatinFonts, nbNOLayouts}, #endif #ifdef LANGUAGE_NN_NO - {L"00000814", 1252, 850, 10000, L"Norwegian (Nynorsk)", 177, LatinFonts, nnNOLayouts}, + {0x00000814, 1252, 850, 10000, L"Norwegian (Nynorsk)", 177, LatinFonts, nnNOLayouts}, #endif #ifdef LANGUAGE_PL_PL - {L"00000415", 1250, 852, 10029, L"Polish", 191, LatinFonts, plPLLayouts}, + {0x00000415, 1250, 852, 10029, L"Polish", 191, LatinFonts, plPLLayouts}, #endif #ifdef LANGUAGE_PT_PT - {L"00000816", 1252, 850, 10000, L"Portuguese (Portugal)", 193, LatinFonts, ptPTLayouts}, + {0x00000816, 1252, 850, 10000, L"Portuguese (Portugal)", 193, LatinFonts, ptPTLayouts}, #endif #ifdef LANGUAGE_PT_BR - {L"00000416", 1252, 850, 10000, L"Portuguese (Brazil)", 32, LatinFonts, ptBRLayouts}, + {0x00000416, 1252, 850, 10000, L"Portuguese (Brazil)", 32, LatinFonts, ptBRLayouts}, #endif #ifdef LANGUAGE_PA_IN - {L"00000446", 0, 1, 2, L"Punjabi (India)", 113, UnicodeFonts, paINLayouts}, + {0x00000446, 0, 1, 2, L"Punjabi (India)", 113, UnicodeFonts, paINLayouts}, #endif #ifdef LANGUAGE_RO_RO - {L"00000418", 28606, 28606, 10029, L"Romanian", 200, LatinFonts, roROLayouts}, + {0x00000418, 28606, 28606, 10029, L"Romanian", 200, LatinFonts, roROLayouts}, #endif #ifdef LANGUAGE_RM_CH - {L"00000417", 1252, 850, 10000, L"Romansh", 223, LatinFonts, rmCHLayouts}, + {0x00000417, 1252, 850, 10000, L"Romansh", 223, LatinFonts, rmCHLayouts}, #endif #ifdef LANGUAGE_RU_RU - {L"00000419", 1251, 866, 10007, L"Russian", 203, CyrillicFonts, ruRULayouts}, + {0x00000419, 1251, 866, 10007, L"Russian", 203, CyrillicFonts, ruRULayouts}, #endif #ifdef LANGUAGE_SA_IN - {L"0000044F", 0, 1, 2, L"Sanskrit", 113, UnicodeFonts, saINLayouts}, + {0x0000044F, 0, 1, 2, L"Sanskrit", 113, UnicodeFonts, saINLayouts}, #endif #ifdef LANGUAGE_SR_SP - {L"00000C1A", 1251, 855, 10007, L"Serbian (Cyrillic)", 271, CyrillicFonts, srSPLayouts}, + {0x00000C1A, 1251, 855, 10007, L"Serbian (Cyrillic)", 271, CyrillicFonts, srSPLayouts}, #endif #ifdef LANGUAGE_SR_SP - {L"0000081A", 1250, 852, 10029, L"Serbian (Latin)", 271, LatinFonts, srSPLayouts}, + {0x0000081A, 1250, 852, 10029, L"Serbian (Latin)", 271, LatinFonts, srSPLayouts}, #endif #ifdef LANGUAGE_SK_SK - {L"0000041B", 1250, 852, 10029, L"Slovak", 143, LatinFonts, skSKLayouts}, + {0x0000041B, 1250, 852, 10029, L"Slovak", 143, LatinFonts, skSKLayouts}, #endif #ifdef LANGUAGE_SL_SI - {L"00000424", 1250, 852, 10029, L"Slovenian", 212, LatinFonts, slSILayouts}, + {0x00000424, 1250, 852, 10029, L"Slovenian", 212, LatinFonts, slSILayouts}, #endif #ifdef LANGUAGE_ES_ES - {L"0000040A", 1252, 850, 10000, L"Spanish (Traditional Sort)", 217, LatinFonts, esESLayouts}, + {0x0000040A, 1252, 850, 10000, L"Spanish (Traditional Sort)", 217, LatinFonts, esESLayouts}, #endif #ifdef LANGUAGE_ES_MX - {L"0000080A", 1252, 850, 10000, L"Spanish (Mexico)", 166, LatinFonts, esMXLayouts}, + {0x0000080A, 1252, 850, 10000, L"Spanish (Mexico)", 166, LatinFonts, esMXLayouts}, #endif #ifdef LANGUAGE_ES_ES - {L"00000C0A", 1252, 850, 10000, L"Spanish (International Sort)", 217, LatinFonts, esESLayouts}, + {0x00000C0A, 1252, 850, 10000, L"Spanish (International Sort)", 217, LatinFonts, esESLayouts}, #endif #ifdef LANGUAGE_ES_GT - {L"0000100A", 1252, 850, 10000, L"Spanish (Guatemala)", 99, LatinFonts, esGTLayouts}, + {0x0000100A, 1252, 850, 10000, L"Spanish (Guatemala)", 99, LatinFonts, esGTLayouts}, #endif #ifdef LANGUAGE_ES_CR - {L"0000140A", 1252, 850, 10000, L"Spanish (Costa Rica)", 54, LatinFonts, esCRLayouts}, + {0x0000140A, 1252, 850, 10000, L"Spanish (Costa Rica)", 54, LatinFonts, esCRLayouts}, #endif #ifdef LANGUAGE_ES_PA - {L"0000180A", 1252, 850, 10000, L"Spanish (Panama)", 192, LatinFonts, esPALayouts}, + {0x0000180A, 1252, 850, 10000, L"Spanish (Panama)", 192, LatinFonts, esPALayouts}, #endif #ifdef LANGUAGE_ES_DO - {L"00001C0A", 1252, 850, 10000, L"Spanish (Dominican Republic)", 65, LatinFonts, esDOLayouts}, + {0x00001C0A, 1252, 850, 10000, L"Spanish (Dominican Republic)", 65, LatinFonts, esDOLayouts}, #endif #ifdef LANGUAGE_ES_VE - {L"0000200A", 1252, 850, 10000, L"Spanish (Venezuela)", 249, LatinFonts, esVELayouts}, + {0x0000200A, 1252, 850, 10000, L"Spanish (Venezuela)", 249, LatinFonts, esVELayouts}, #endif #ifdef LANGUAGE_ES_CO - {L"0000240A", 1252, 850, 10000, L"Spanish (Colombia)", 51, LatinFonts, esCOLayouts}, + {0x0000240A, 1252, 850, 10000, L"Spanish (Colombia)", 51, LatinFonts, esCOLayouts}, #endif #ifdef LANGUAGE_ES_PE - {L"0000280A", 1252, 850, 10000, L"Spanish (Peru)", 187, LatinFonts, esPELayouts}, + {0x0000280A, 1252, 850, 10000, L"Spanish (Peru)", 187, LatinFonts, esPELayouts}, #endif #ifdef LANGUAGE_ES_AR - {L"00002C0A", 1252, 850, 10000, L"Spanish (Argentina)", 11, LatinFonts, esARLayouts}, + {0x00002C0A, 1252, 850, 10000, L"Spanish (Argentina)", 11, LatinFonts, esARLayouts}, #endif #ifdef LANGUAGE_ES_EC - {L"0000300A", 1252, 850, 10000, L"Spanish (Ecuador)", 66, LatinFonts, esECLayouts}, + {0x0000300A, 1252, 850, 10000, L"Spanish (Ecuador)", 66, LatinFonts, esECLayouts}, #endif #ifdef LANGUAGE_ES_CL - {L"0000340A", 1252, 850, 10000, L"Spanish (Chile)", 46, LatinFonts, esCLLayouts}, + {0x0000340A, 1252, 850, 10000, L"Spanish (Chile)", 46, LatinFonts, esCLLayouts}, #endif #ifdef LANGUAGE_ES_UY - {L"0000380A", 1252, 850, 10000, L"Spanish (Uruguay)", 246, LatinFonts, esUYLayouts}, + {0x0000380A, 1252, 850, 10000, L"Spanish (Uruguay)", 246, LatinFonts, esUYLayouts}, #endif #ifdef LANGUAGE_ES_PY - {L"00003C0A", 1252, 850, 10000, L"Spanish (Paraguay)", 185, LatinFonts, esPYLayouts}, + {0x00003C0A, 1252, 850, 10000, L"Spanish (Paraguay)", 185, LatinFonts, esPYLayouts}, #endif #ifdef LANGUAGE_ES_BO - {L"0000400A", 1252, 850, 10000, L"Spanish (Bolivia)", 26, LatinFonts, esBOLayouts}, + {0x0000400A, 1252, 850, 10000, L"Spanish (Bolivia)", 26, LatinFonts, esBOLayouts}, #endif #ifdef LANGUAGE_ES_SV - {L"0000440A", 1252, 850, 10000, L"Spanish (El Salvador)", 72, LatinFonts, esSVLayouts}, + {0x0000440A, 1252, 850, 10000, L"Spanish (El Salvador)", 72, LatinFonts, esSVLayouts}, #endif #ifdef LANGUAGE_ES_HN - {L"0000480A", 1252, 850, 10000, L"Spanish (Honduras)", 106, LatinFonts, esHNLayouts}, + {0x0000480A, 1252, 850, 10000, L"Spanish (Honduras)", 106, LatinFonts, esHNLayouts}, #endif #ifdef LANGUAGE_ES_NI - {L"00004C0A", 1252, 850, 10000, L"Spanish (Nicaragua)", 182, LatinFonts, esNILayouts}, + {0x00004C0A, 1252, 850, 10000, L"Spanish (Nicaragua)", 182, LatinFonts, esNILayouts}, #endif #ifdef LANGUAGE_ES_PR - {L"0000500A", 1252, 850, 10000, L"Spanish (Puerto Rico)", 202, LatinFonts, esPRLayouts}, + {0x0000500A, 1252, 850, 10000, L"Spanish (Puerto Rico)", 202, LatinFonts, esPRLayouts}, #endif #ifdef LANGUAGE_SW_KE - {L"00000441", 1252, 437, 10000, L"Swahili", 129, LatinFonts, swKELayouts}, + {0x00000441, 1252, 437, 10000, L"Swahili", 129, LatinFonts, swKELayouts}, #endif #ifdef LANGUAGE_SV_SE - {L"0000041D", 1252, 850, 10000, L"Swedish", 221, LatinFonts, svSELayouts}, + {0x0000041D, 1252, 850, 10000, L"Swedish", 221, LatinFonts, svSELayouts}, #endif #ifdef LANGUAGE_SV_FI - {L"0000081D", 1252, 850, 10000, L"Swedish (Finland)", 77, LatinFonts, svFILayouts}, + {0x0000081D, 1252, 850, 10000, L"Swedish (Finland)", 77, LatinFonts, svFILayouts}, #endif #ifdef LANGUAGE_SYR_SY - {L"0000045A", 0, 1, 2, L"Syriac (Syria)", 222, UnicodeFonts, syrSYLayouts}, + {0x0000045A, 0, 1, 2, L"Syriac (Syria)", 222, UnicodeFonts, syrSYLayouts}, #endif #ifdef LANGUAGE_TA_IN - {L"00000449", 0, 1, 2, L"Tamil", 113, UnicodeFonts, taINLayouts}, + {0x00000449, 0, 1, 2, L"Tamil", 113, UnicodeFonts, taINLayouts}, #endif #ifdef LANGUAGE_TT_TA - {L"00000444", 1251, 866, 10007, L"Tatar", 1, CyrillicFonts, ttTALayouts}, + {0x00000444, 1251, 866, 10007, L"Tatar", 1, CyrillicFonts, ttTALayouts}, #endif #ifdef LANGUAGE_TE_IN - {L"0000044A", 0, 1, 2, L"Telugu (India)", 113, UnicodeFonts, teINLayouts}, + {0x0000044A, 0, 1, 2, L"Telugu (India)", 113, UnicodeFonts, teINLayouts}, #endif #ifdef LANGUAGE_TH_TH - {L"0000041E", 874, 874, 10021, L"Thai", 227, UnicodeFonts, thTHLayouts}, + {0x0000041E, 874, 874, 10021, L"Thai", 227, UnicodeFonts, thTHLayouts}, #endif #ifdef LANGUAGE_TR_TR - {L"0000041F", 1254, 857, 10081, L"Turkish", 235, LatinFonts, trTRLayouts}, + {0x0000041F, 1254, 857, 10081, L"Turkish", 235, LatinFonts, trTRLayouts}, #endif #ifdef LANGUAGE_UK_UA - {L"00000422", 1251, 866, 10017, L"Ukrainian", 241, CyrillicFonts, ukUALayouts}, + {0x00000422, 1251, 866, 10017, L"Ukrainian", 241, CyrillicFonts, ukUALayouts}, #endif #ifdef LANGUAGE_UR_PK - {L"00000420", 1256, 720, 10004, L"Urdu", 190, UnicodeFonts, urPKLayouts}, + {0x00000420, 1256, 720, 10004, L"Urdu", 190, UnicodeFonts, urPKLayouts}, #endif #ifdef LANGUAGE_UZ_UZ - {L"00000443", 1254, 857, 10029, L"Uzbek (Latin)", 247, LatinFonts, uzUZLayouts}, + {0x00000443, 1254, 857, 10029, L"Uzbek (Latin)", 247, LatinFonts, uzUZLayouts}, #endif #ifdef LANGUAGE_UZ_UZ - {L"00000843", 1251, 866, 10007, L"Uzbek (Cyrillic)", 247, CyrillicFonts, uzUZLayouts}, + {0x00000843, 1251, 866, 10007, L"Uzbek (Cyrillic)", 247, CyrillicFonts, uzUZLayouts}, #endif #ifdef LANGUAGE_VI_VN - {L"0000042A", 1258, 1258, 10000, L"Vietnamese", 251, UnicodeFonts, viVNLayouts}, + {0x0000042A, 1258, 1258, 10000, L"Vietnamese", 251, UnicodeFonts, viVNLayouts}, #endif #ifdef LANGUAGE_WA_BE - {L"00000490", 1252, 850, 10000, L"Walon", 21, LatinFonts, waBELayouts}, + {0x00000490, 1252, 850, 10000, L"Walon", 21, LatinFonts, waBELayouts}, #endif #ifdef LANGUAGE_ZU_ZU - {L"00000435", 1252, 850, 10000, L"Zulu", 1, LatinFonts, zuZULayouts}, + {0x00000435, 1252, 850, 10000, L"Zulu", 1, LatinFonts, zuZULayouts}, #endif - {NULL, 0, 0, 0, NULL, 0, NULL, NULL} + {0, 0, 0, 0, NULL, 0, NULL, NULL} }; diff --git a/base/setup/lib/settings.c b/base/setup/lib/settings.c index 44f3c97368f..2de2afdf54f 100644 --- a/base/setup/lib/settings.c +++ b/base/setup/lib/settings.c @@ -322,34 +322,45 @@ GetComputerIdentifier( } -/* - * Return values: - * 0x00: Failure, stop the enumeration; - * 0x01: Add the entry and continue the enumeration; - * 0x02: Skip the entry but continue the enumeration. - */ -typedef UCHAR -(NTAPI *PPROCESS_ENTRY_ROUTINE)( - IN PCWSTR KeyName, - IN PCWSTR KeyValue, - OUT PVOID* UserData, - OUT PBOOLEAN Current, - IN PVOID Parameter OPTIONAL); - +/** + * @brief + * Enumerate "KeyName=KeyValue" entries from under a specified section + * from the given TXTSETUP.SIF file. + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in] SectionName + * The name of the section whose entries are to be enumerated. + * + * @param[in] pContext + * Pointer to the INF parsing context. + * + * @param[in] DefaultEntry + * TODO TODO TODO + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each enumerated entry. + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return + * The total count of entries found in the section, or zero if none. + * Returns -1 in case of failure. + **/ static LONG -AddEntriesFromInfSection( - IN OUT PGENERIC_LIST List, - IN HINF InfFile, - IN PCWSTR SectionName, - IN PINFCONTEXT pContext, - IN PPROCESS_ENTRY_ROUTINE ProcessEntry, - IN PVOID Parameter OPTIONAL) +EnumEntriesFromInfSection( + _In_ HINF InfFile, + _In_ PCWSTR SectionName, + _In_ PINFCONTEXT pContext, + /**/_In_opt_ ULONG_PTR DefaultEntry,/**/ // PCWSTR DefaultKeyName + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) { LONG TotalCount = 0; PCWSTR KeyName; PCWSTR KeyValue; - PVOID UserData; - BOOLEAN Current; UCHAR RetVal; if (!SpInfFindFirstLine(InfFile, SectionName, NULL, pContext)) @@ -376,24 +387,18 @@ AddEntriesFromInfSection( return -1; } - UserData = NULL; - Current = FALSE; - RetVal = ProcessEntry(KeyName, - KeyValue, - &UserData, - &Current, - Parameter); + RetVal = EnumEntryProc(KeyName, KeyValue, DefaultEntry, Parameter); + INF_FreeData(KeyName); INF_FreeData(KeyValue); if (RetVal == 0) { - DPRINT("ProcessEntry() failed\n"); + DPRINT("EnumEntryProc() failed\n"); return -1; } else if (RetVal == 1) { - AppendGenericListEntry(List, UserData, Current); ++TotalCount; } // else if (RetVal == 2), skip the entry. @@ -403,145 +408,132 @@ AddEntriesFromInfSection( return TotalCount; } -static UCHAR -NTAPI -DefaultProcessEntry( - IN PCWSTR KeyName, - IN PCWSTR KeyValue, - OUT PVOID* UserData, - OUT PBOOLEAN Current, - IN PVOID Parameter OPTIONAL) -{ - PWSTR CompareKey = (PWSTR)Parameter; - PGENENTRY GenEntry; - SIZE_T IdSize, ValueSize; - - IdSize = (wcslen(KeyName) + 1) * sizeof(WCHAR); - ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR); - - GenEntry = RtlAllocateHeap(ProcessHeap, 0, - sizeof(*GenEntry) + IdSize + ValueSize); - if (GenEntry == NULL) - { - /* Failure, stop enumeration */ - DPRINT1("RtlAllocateHeap() failed\n"); - return 0; - } - - GenEntry->Id = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry)); - GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry) + IdSize); - RtlStringCbCopyW((PWSTR)GenEntry->Id, IdSize, KeyName); - RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue); - - *UserData = GenEntry; - *Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE); - - /* Add the entry */ - return 1; -} - - -BOOLEAN +static BOOLEAN AddComputerTypeEntries( _In_ HINF InfFile, - PGENERIC_LIST List, - _In_ PWSTR SectionName) + _In_ PCWSTR SectionName, + _Inout_opt_ PCWSTR* CurrentComputerType, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) { INFCONTEXT Context; - PCWSTR KeyName; - PCWSTR KeyValue; WCHAR ComputerIdentifier[128]; WCHAR ComputerKey[32]; ULONG Count1, Count2; /* Get the computer identification */ - if (!GetComputerIdentifier(ComputerIdentifier, 128)) - { + if (!GetComputerIdentifier(ComputerIdentifier, _countof(ComputerIdentifier))) ComputerIdentifier[0] = 0; - } DPRINT("Computer identifier: '%S'\n", ComputerIdentifier); - /* Search for matching device identifier */ - if (!SpInfFindFirstLine(InfFile, SectionName, NULL, &Context)) + if (!CurrentComputerType || !*CurrentComputerType) { - /* FIXME: error message */ - return FALSE; + /* Search for matching device identifier (that should be the default one) */ + if (!SpInfFindFirstLine(InfFile, SectionName, NULL, &Context)) + return FALSE; + + do + { + PCWSTR KeyName; + PCWSTR KeyValue; + BOOLEAN FoundId; + + if (!INF_GetDataField(&Context, 1, &KeyValue)) + { + /* FIXME: Handle error! */ + DPRINT("INF_GetDataField() failed\n"); + return FALSE; + } + + DPRINT("KeyValue: %S\n", KeyValue); + FoundId = !!wcsstr(ComputerIdentifier, KeyValue); + INF_FreeData(KeyValue); + + if (!FoundId) + continue; + + if (!INF_GetDataField(&Context, 0, &KeyName)) + { + /* FIXME: Handle error! */ + DPRINT("INF_GetDataField() failed\n"); + return FALSE; + } + + DPRINT("Computer key: %S\n", KeyName); + RtlStringCchCopyW(ComputerKey, ARRAYSIZE(ComputerKey), KeyName); + INF_FreeData(KeyName); + } while (SpInfFindNextLine(&Context, &Context)); + + CurrentComputerType = &ComputerKey; } - do - { - BOOLEAN FoundId; - - if (!INF_GetDataField(&Context, 1, &KeyValue)) - { - /* FIXME: Handle error! */ - DPRINT("INF_GetDataField() failed\n"); - return FALSE; - } - - DPRINT("KeyValue: %S\n", KeyValue); - FoundId = !!wcsstr(ComputerIdentifier, KeyValue); - INF_FreeData(KeyValue); - - if (!FoundId) - continue; - - if (!INF_GetDataField(&Context, 0, &KeyName)) - { - /* FIXME: Handle error! */ - DPRINT("INF_GetDataField() failed\n"); - return FALSE; - } - - DPRINT("Computer key: %S\n", KeyName); - RtlStringCchCopyW(ComputerKey, ARRAYSIZE(ComputerKey), KeyName); - INF_FreeData(KeyName); - } while (SpInfFindNextLine(&Context, &Context)); - - Count1 = AddEntriesFromInfSection(List, - InfFile, - L"Computer", - &Context, - DefaultProcessEntry, - ComputerKey); - Count2 = AddEntriesFromInfSection(List, - InfFile, - L"Computer.NT" INF_ARCH, - &Context, - DefaultProcessEntry, - ComputerKey); + Count1 = EnumEntriesFromInfSection(InfFile, + L"Computer", + &Context, + (ULONG_PTR)ComputerKey, + EnumEntryProc, + Parameter); + Count2 = EnumEntriesFromInfSection(InfFile, + L"Computer.NT" INF_ARCH, + &Context, + (ULONG_PTR)ComputerKey, + EnumEntryProc, + Parameter); if ((Count1 == -1) && (Count2 == -1)) { return FALSE; } + // *CurrentComputerType; + return TRUE; } -PGENERIC_LIST -CreateComputerTypeList( - IN HINF InfFile) +/** + * @brief + * Enumerate computer type entries from the given TXTSETUP.SIF file. + * The examined sections are: "Map.Computer", "Computer", as well as + * the platform-specific "Map.Computer.NT**" and "Computer.NT**". + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in,out] CurrentComputerType + * Optional parameter, pointing to a string pointer which: + * - in input, provides the computer type to look for (if it is NULL, + * the current computer type is determined at runtime); + * - in output, receives the current computer type, or NULL if it is + * not described in the TXTSETUP.SIF file. + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each computer type listed in TXTSETUP.SIF + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return TRUE if entries have been successfully enumerated; FALSE if not. + **/ +BOOLEAN +EnumComputerTypeEntries( + _In_ HINF InfFile, + _Inout_opt_ PCWSTR* CurrentComputerType, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) { - PGENERIC_LIST List; BOOLEAN Success; - List = CreateGenericList(); - if (List == NULL) - return NULL; - - Success = AddComputerTypeEntries(InfFile, List, L"Map.Computer"); - Success |= AddComputerTypeEntries(InfFile, List, L"Map.Computer.NT" INF_ARCH); - if (!Success) - { - DestroyGenericList(List, TRUE); - return NULL; - } - - return List; + Success = AddComputerTypeEntries(InfFile, L"Map.Computer", + CurrentComputerType, + EnumEntryProc, Parameter); + Success |= AddComputerTypeEntries(InfFile, L"Map.Computer.NT" INF_ARCH, + CurrentComputerType, + EnumEntryProc, Parameter); + return Success; } + static BOOLEAN GetDisplayIdentifier( @@ -704,85 +696,646 @@ GetDisplayIdentifier( return FALSE; } -PGENERIC_LIST -CreateDisplayDriverList( - IN HINF InfFile) +/** + * @brief + * Enumerate display driver entries from the given TXTSETUP.SIF file. + * The examined sections are: "Map.Display" and "Display". + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in,out] CurrentDisplayType + * Optional parameter, pointing to a string pointer which: + * - in input, provides the display type to look for (if it is NULL, + * the current display type is determined at runtime); + * - in output, receives the current display type, or NULL if it is + * not described in the TXTSETUP.SIF file. + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each display type listed in TXTSETUP.SIF + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return TRUE if entries have been successfully enumerated; FALSE if not. + **/ +BOOLEAN +EnumDisplayDriverEntries( + _In_ HINF InfFile, + _Inout_opt_ PCWSTR* CurrentDisplayType, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) { - PGENERIC_LIST List; INFCONTEXT Context; - PCWSTR KeyName; - PCWSTR KeyValue; WCHAR DisplayIdentifier[128]; WCHAR DisplayKey[32]; /* Get the display identification */ - if (!GetDisplayIdentifier(DisplayIdentifier, 128)) - { + if (!GetDisplayIdentifier(DisplayIdentifier, _countof(DisplayIdentifier))) DisplayIdentifier[0] = 0; - } DPRINT("Display identifier: '%S'\n", DisplayIdentifier); - /* Search for matching device identifier */ - if (!SpInfFindFirstLine(InfFile, L"Map.Display", NULL, &Context)) + if (!CurrentDisplayType || !*CurrentDisplayType) { - /* FIXME: error message */ - return NULL; + /* Search for matching device identifier (that should be the default one) */ + if (!SpInfFindFirstLine(InfFile, L"Map.Display", NULL, &Context)) + return FALSE; + + do + { + PCWSTR KeyName; + PCWSTR KeyValue; + BOOLEAN FoundId; + + if (!INF_GetDataField(&Context, 1, &KeyValue)) + { + /* FIXME: Handle error! */ + DPRINT("INF_GetDataField() failed\n"); + return FALSE; + } + + DPRINT("KeyValue: %S\n", KeyValue); + FoundId = !!wcsstr(DisplayIdentifier, KeyValue); + INF_FreeData(KeyValue); + + if (!FoundId) + continue; + + if (!INF_GetDataField(&Context, 0, &KeyName)) + { + /* FIXME: Handle error! */ + DPRINT("INF_GetDataField() failed\n"); + return FALSE; + } + + DPRINT("Display key: %S\n", KeyName); + RtlStringCchCopyW(DisplayKey, ARRAYSIZE(DisplayKey), KeyName); + INF_FreeData(KeyName); + } while (SpInfFindNextLine(&Context, &Context)); + + CurrentDisplayType = &DisplayKey; } - do + if (EnumEntriesFromInfSection(InfFile, + L"Display", + &Context, + (ULONG_PTR)DisplayKey, + EnumEntryProc, + Parameter) == -1) { - BOOLEAN FoundId; + return FALSE; + } - if (!INF_GetDataField(&Context, 1, &KeyValue)) +#if 0 + // FIXME: How to express that this one should be the default one? + EnumEntryProc(L"Other display driver", NULL, /*DisplayKey*/NULL, Parameter); + // AppendGenericListEntry(List, L"Other display driver", NULL, TRUE); +#endif + + return TRUE; +} + + +/** + * @brief + * Enumerate keyboard driver entries from the given TXTSETUP.SIF file. + * The examined sections are: "Map.Keyboard" and "Keyboard". + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in,out] CurrentKeyboardType + * Optional parameter, pointing to a string pointer which: + * - in input, provides the keyboard type to look for (if it is NULL, + * the current keyboard type is determined at runtime); + * - in output, receives the current keyboard type, or NULL if it is + * not described in the TXTSETUP.SIF file. + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each keyboard type listed in TXTSETUP.SIF + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return TRUE if entries have been successfully enumerated; FALSE if not. + **/ +BOOLEAN +EnumKeyboardDriverEntries( + _In_ HINF InfFile, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) +{ + INFCONTEXT Context; + + // TODO: Handle "Map.Keyboard" + + return (EnumEntriesFromInfSection(InfFile, + L"Keyboard", + &Context, + (ULONG_PTR)NULL, + EnumEntryProc, + Parameter) != -1); +} + + +/** + * @brief + * Enumerate language entries from the given TXTSETUP.SIF file. + * The examined values are: "NLS\DefaultLanguage" (ReactOS-specific) + * and "NLS\DefaultLayout", and the examined sections are: "Language". + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in,out] CurrentKeyboardType + * Optional parameter, pointing to a string pointer which: + * - in input, provides the language to look for (if it is NULL, + * the current language is determined at runtime); + * - in output, receives the current language, or NULL if it is + * not described in the TXTSETUP.SIF file. + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each language listed in TXTSETUP.SIF + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return TRUE if entries have been successfully enumerated; FALSE if not. + **/ +BOOLEAN +EnumLanguageEntries( + _In_ HINF InfFile, + _Out_opt_ LANGID* DefaultLanguage, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) +{ + INFCONTEXT Context; + + if (DefaultLanguage) + { + /* Get default language ID (ReactOS-specific); + * if none, use the one from "DefaultLayout" */ + if (SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLanguage", &Context) || + SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLayout", &Context)) { - /* FIXME: Handle error! */ - DPRINT("INF_GetDataField() failed\n"); - return NULL; + /* This is a <= 8-character long hexadecimal string */ + PCWSTR KeyValue; + if (!INF_GetData(&Context, NULL, &KeyValue)) + return FALSE; + *DefaultLanguage = (LANGID)(wcstoul(KeyValue, NULL, 16) & 0xFFFF); } - - DPRINT("KeyValue: %S\n", KeyValue); - FoundId = !!wcsstr(DisplayIdentifier, KeyValue); - INF_FreeData(KeyValue); - - if (!FoundId) - continue; - - if (!INF_GetDataField(&Context, 0, &KeyName)) + else { - /* FIXME: Handle error! */ - DPRINT("INF_GetDataField() failed\n"); - return NULL; + /* None, default to en-US */ + DPRINT1("No NLS\\DefaultLayout value, default to en-US\n"); + *DefaultLanguage = 0x0409; } + } - DPRINT("Display key: %S\n", KeyName); - RtlStringCchCopyW(DisplayKey, ARRAYSIZE(DisplayKey), KeyName); - INF_FreeData(KeyName); - } while (SpInfFindNextLine(&Context, &Context)); + if (EnumEntriesFromInfSection(InfFile, + L"Language", + &Context, + (ULONG_PTR)*DefaultLanguage, + EnumEntryProc, + Parameter) == -1) + { + // FIXME: Just fall back to en-US + return FALSE; + } + + return TRUE; +} + + +/** + * @brief + * Enumerate keyboard layout entries from the given TXTSETUP.SIF file. + * The examined values are: "NLS\DefaultLayout", and the examined sections + * are: "KeyboardLayout" (NOTE: ReactOS-specific; on Windows it is named + * "Keyboard Layout" instead). + * + * @param[in] InfFile + * An INF file handle to TXTSETUP.SIF. + * + * @param[in] LanguageId + * The language ID for which to enumerate corresponding keyboard layouts. + * + * @param[in,out] CurrentKeyboardType + * Optional parameter, pointing to a string pointer which: + * - in input, provides the keyboard layout to look for (if it is NULL, + * the current keyboard layout is determined at runtime); + * - in output, receives the current keyboard layout, or NULL if it is + * not described in the TXTSETUP.SIF file. + * + * @param[in] EnumEntryProc + * User-provided callback invoked for each keyboard layout listed in TXTSETUP.SIF + * + * @param[in] Parameter + * Optional parameter for the callback. + * + * @return TRUE if entries have been successfully enumerated; FALSE if not. + **/ +BOOLEAN +EnumKeyboardLayoutEntries( + _In_ HINF InfFile, + _In_ LANGID LanguageId, + _Out_ KLID* DefaultKBLayout, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter) +{ + INFCONTEXT Context; + const MUI_LAYOUTS* LayoutsList; + ULONG uIndex; + + /* Get default layout ID */ + if (SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLayout", &Context)) + { + /* This is a <= 8-character long hexadecimal string */ + PCWSTR KeyValue; + if (!INF_GetData(&Context, NULL, &KeyValue)) + return FALSE; + *DefaultKBLayout = (KLID)wcstoul(KeyValue, NULL, 16); + } + else + { + /* None, default to en-US */ + DPRINT1("No NLS\\DefaultLayout value, default to en-US\n"); + *DefaultKBLayout = 0x00000409; + } + + LayoutsList = MUIGetLayoutsList(LanguageId); + for (uIndex = 0; LayoutsList[uIndex].LangID != 0; ++uIndex) + { + // NOTE: See https://git.reactos.org/?p=reactos.git;a=commit;h=785b2eb8b8c6222bb961f5368d51f1a50640dc96 + // "Make the keyboard layouts selection not dependent on the selected language." r68354 CORE-9630 + if (EnumEntriesFromInfSection(InfFile, + L"KeyboardLayout", // NOTE: Windows TXTSETUP.SIF names this: "Keyboard Layout" + &Context, + (ULONG_PTR)DefaultKBLayout, + EnumEntryProc, + Parameter) == -1) + { + return FALSE; + } + } + + return TRUE; +} + + +ULONG +GetDefaultLanguageIndex(VOID) +{ + return DefaultLanguageIndex; +} + + + + +// +// Callback to add an entry to a PGENERIC_LIST -- For USETUP only +// +static UCHAR +NTAPI +DefaultProcessEntry( + _In_ PCWSTR KeyName, + _In_opt_ PCWSTR KeyValue, + /**/_In_ ULONG_PTR DefaultEntry,/**/ // PCWSTR DefaultKeyName + _In_opt_ PVOID Parameter) +{ + PCWSTR CompareKey = (PCWSTR)DefaultEntry; + PGENERIC_LIST List = (PGENERIC_LIST)Parameter; + PGENENTRY GenEntry; + SIZE_T IdSize, ValueSize; + BOOLEAN Current; + + IdSize = (wcslen(KeyName) + 1) * sizeof(WCHAR); + ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR); + + GenEntry = RtlAllocateHeap(ProcessHeap, 0, + sizeof(*GenEntry) + IdSize + ValueSize); + if (!GenEntry) + { + /* Failure, stop enumeration */ + DPRINT1("RtlAllocateHeap() failed\n"); + return 0; + } + + GenEntry->Id.Str = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry)); + GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry) + IdSize); + RtlStringCbCopyW((PWSTR)GenEntry->Id.Str, IdSize, KeyName); + RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue); + + Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE); + + /* Add the entry */ + if (AppendGenericListEntry(List, GenEntry, Current)) + { + return 1; + } + else + { + /* Failure, stop enumeration */ + RtlFreeHeap(ProcessHeap, 0, GenEntry); + return 0; + } +} + +// +// This is for USETUP. GUI setup can enumerate within a combolist. +// +PGENERIC_LIST +CreateComputerTypeList( + _In_ HINF InfFile) +{ + PGENERIC_LIST List; List = CreateGenericList(); - if (List == NULL) + if (!List) return NULL; - if (AddEntriesFromInfSection(List, - InfFile, - L"Display", - &Context, - DefaultProcessEntry, - DisplayKey) == -1) + if (!EnumComputerTypeEntries(InfFile, DefaultProcessEntry, List)) { DestroyGenericList(List, TRUE); return NULL; } + return List; +} + +// +// This is for USETUP. GUI setup can enumerate within a combolist. +// +PGENERIC_LIST +CreateDisplayDriverList( + _In_ HINF InfFile) +{ + PGENERIC_LIST List; + + List = CreateGenericList(); + if (!List) + return NULL; + + if (!EnumDisplayDriverEntries(InfFile, DefaultProcessEntry, List)) + { + DestroyGenericList(List, TRUE); + return NULL; + } + + return List; +} + +// +// This is for USETUP. GUI setup can enumerate within a combolist. +// +PGENERIC_LIST +CreateKeyboardDriverList( + _In_ HINF InfFile) +{ + PGENERIC_LIST List; + + List = CreateGenericList(); + if (!List) + return NULL; + + if (!EnumKeyboardDriverEntries(InfFile, DefaultProcessEntry, List)) + { + DestroyGenericList(List, TRUE); + return NULL; + } + + return List; +} + + +typedef struct _LANG_ENTRY_PARAM +{ + PGENERIC_LIST List; + ULONG uIndex; + LANGID DefaultLanguage; +} LANG_ENTRY_PARAM, *PLANG_ENTRY_PARAM; + +static UCHAR +NTAPI +ProcessLangEntry( + _In_ PCWSTR KeyName, + _In_opt_ PCWSTR KeyValue, + /**/_In_ ULONG_PTR DefaultEntry,/**/ // PCWSTR DefaultKeyName + _In_opt_ PVOID Parameter) +{ + PLANG_ENTRY_PARAM LangEntryParam = (PLANG_ENTRY_PARAM)Parameter; + PGENERIC_LIST List = LangEntryParam->List; + PGENENTRY GenEntry; + SIZE_T ValueSize; + LANGID LangId; + BOOLEAN Current; + + LangId = (LANGID)(wcstoul(KeyName, NULL, 16) & 0xFFFF); + if (!IsLanguageAvailable(LangId)) + { + /* The specified language is unavailable, skip the entry */ + return 2; + } + + ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR); + + GenEntry = RtlAllocateHeap(ProcessHeap, 0, + sizeof(*GenEntry) + ValueSize); + if (!GenEntry) + { + /* Failure, stop enumeration */ + DPRINT1("RtlAllocateHeap() failed\n"); + return 0; + } + + GenEntry->Id.Ul = (ULONG_PTR)LangId; + GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry)); + RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue); + + Current = FALSE; + + if (LangId == LangEntryParam->DefaultLanguage) + { + DefaultLanguageIndex = LangEntryParam->uIndex; + Current = TRUE; + } + + LangEntryParam->uIndex++; + + /* Add the entry */ + if (AppendGenericListEntry(List, GenEntry, Current)) + { + return 1; + } + else + { + /* Failure, stop enumeration */ + RtlFreeHeap(ProcessHeap, 0, GenEntry); + return 0; + } +} + +// +// This is for USETUP. GUI setup can enumerate within a combolist. +// +PGENERIC_LIST +CreateLanguageList( + _In_ HINF InfFile, + _Inout_ LANGID* DefaultLanguage) +{ + PGENERIC_LIST List; + LANG_ENTRY_PARAM LangEntryParam; #if 0 - AppendGenericListEntry(List, L"Other display driver", NULL, TRUE); + LANGID OrigDefaultLanguage = *DefaultLanguage; +#endif + + List = CreateGenericList(); + if (!List) + return NULL; + + LangEntryParam.List = List; + LangEntryParam.uIndex = 0; + LangEntryParam.DefaultLanguage = *DefaultLanguage; + + if (!EnumLanguageEntries(InfFile, DefaultLanguage, + ProcessLangEntry/*DefaultProcessEntry*/, + &LangEntryParam)) + { + // FIXME: Just fall back to en-US + DestroyGenericList(List, TRUE); + return NULL; + } + + /* Only one language available, make it the default one */ + if (LangEntryParam.uIndex == 1) + { + DefaultLanguageIndex = 0; + SetCurrentListEntry(List, GetFirstListEntry(List)); + *DefaultLanguage = (LANGID)(((PGENENTRY)GetListEntryData(GetFirstListEntry(List)))->Id.Ul); + } + + +// +// FIXME: Check whether such a hack (inspired from +// the IsUnattendedSetup thing) is still necessary... +// +#if 0 + if (OrigDefaultLanguage != 0) + { + PGENERIC_LIST_ENTRY ListEntry; + LCID LocaleId; + + /* first we hack LanguageList */ + for (ListEntry = GetFirstListEntry(List); ListEntry; + ListEntry = GetNextListEntry(ListEntry)) + { + LocaleId = (LCID)(((PGENENTRY)GetListEntryData(ListEntry))->Id.Ul); + if (OrigDefaultLanguage == (LANGID)LocaleId) + { + DPRINT("Found 0x%08lx in LanguageList\n", LocaleId); + SetCurrentListEntry(List, ListEntry); + break; + } + } + } +#endif + + + return List; +} + + +static UCHAR +NTAPI +ProcessLayoutEntry( + _In_ PCWSTR KeyName, + _In_opt_ PCWSTR KeyValue, + /**/_In_ ULONG_PTR DefaultEntry,/**/ // PCWSTR DefaultKeyName + _In_opt_ PVOID Parameter) +{ + PGENERIC_LIST List = (PGENERIC_LIST)Parameter; + PGENENTRY GenEntry; + SIZE_T ValueSize; + KLID LayoutId; + BOOLEAN Current; + + LayoutId = (KLID)wcstoul(KeyName, NULL, 16); + + ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR); + + GenEntry = RtlAllocateHeap(ProcessHeap, 0, + sizeof(*GenEntry) + ValueSize); + if (!GenEntry) + { + /* Failure, stop enumeration */ + DPRINT1("RtlAllocateHeap() failed\n"); + return 0; + } + + GenEntry->Id.Ul = (ULONG_PTR)LayoutId; + GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry)); + RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue); + + Current = FALSE; // (LayoutId == (KLID)DefaultEntry); + + /* Add the entry */ + if (AppendGenericListEntry(List, GenEntry, Current)) + { + return 1; + } + else + { + /* Failure, stop enumeration */ + RtlFreeHeap(ProcessHeap, 0, GenEntry); + return 0; + } +} + +// +// This is for USETUP. GUI setup can enumerate within a combolist. +// +PGENERIC_LIST +CreateKeyboardLayoutList( + _In_ HINF InfFile, + _In_ LANGID LanguageId, + _Out_ KLID* DefaultKBLayout) // FIXME: Investigate whether this could be Inout (see usetup.c!UpdateKBLayout) +{ + PGENERIC_LIST List; + + List = CreateGenericList(); + if (!List) + return NULL; + + if (!EnumKeyboardLayoutEntries(InfFile, + LanguageId, + DefaultKBLayout, + ProcessLayoutEntry, + List)) + { + // FIXME: Just fall back to en-US + DestroyGenericList(List, TRUE); + return NULL; + } + + /* Check whether some keyboard layouts have been found */ + /* FIXME: Handle this case */ +#if 0 // Actually this code is useless. + if (GetNumberOfListEntries(List) == 0) + { + DPRINT1("No keyboard layouts have been found\n"); + DestroyGenericList(List, TRUE); + return NULL; + } #endif return List; } + + + BOOLEAN ProcessComputerFiles( _In_ HINF InfFile, @@ -967,15 +1520,19 @@ ProcessDisplayRegistry( BOOLEAN ProcessLocaleRegistry( - _In_ PCWSTR LanguageId) + _In_ LCID LocaleId) { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName; UNICODE_STRING ValueName; HANDLE KeyHandle; NTSTATUS Status; + WCHAR Value[sizeof("FFFFFFFF")]; - DPRINT("LanguageId: %S\n", LanguageId); + Status = RtlStringCchPrintfW(Value, _countof(Value), L"%08lx", LocaleId); + ASSERT(NT_SUCCESS(Status)); + + DPRINT("LocaleId: %S\n", Value); /* Open the default users locale key */ RtlInitUnicodeString(&KeyName, @@ -1002,8 +1559,8 @@ ProcessLocaleRegistry( &ValueName, 0, REG_SZ, - (PVOID)LanguageId, - (wcslen(LanguageId) + 1) * sizeof(WCHAR)); + (PVOID)Value, + (wcslen(Value) + 1) * sizeof(WCHAR)); NtClose(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -1011,9 +1568,9 @@ ProcessLocaleRegistry( return FALSE; } - /* Skip first 4 zeroes */ - if (wcslen(LanguageId) >= 4) - LanguageId += 4; + /* Just get the language ID */ + Status = RtlStringCchPrintfW(Value, _countof(Value), L"%04lx", LANGIDFROMLCID(LocaleId)); + ASSERT(NT_SUCCESS(Status)); /* Open the NLS language key */ RtlInitUnicodeString(&KeyName, @@ -1040,8 +1597,8 @@ ProcessLocaleRegistry( &ValueName, 0, REG_SZ, - (PVOID)LanguageId, - (wcslen(LanguageId) + 1) * sizeof(WCHAR)); + (PVOID)Value, + (wcslen(Value) + 1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status); @@ -1055,8 +1612,8 @@ ProcessLocaleRegistry( &ValueName, 0, REG_SZ, - (PVOID)LanguageId, - (wcslen(LanguageId) + 1) * sizeof(WCHAR)); + (PVOID)Value, + (wcslen(Value) + 1) * sizeof(WCHAR)); NtClose(KeyHandle); if (!NT_SUCCESS(Status)) { @@ -1067,222 +1624,23 @@ ProcessLocaleRegistry( return TRUE; } - -PGENERIC_LIST -CreateKeyboardDriverList( - IN HINF InfFile) -{ - PGENERIC_LIST List; - INFCONTEXT Context; - - List = CreateGenericList(); - if (List == NULL) - return NULL; - - if (AddEntriesFromInfSection(List, - InfFile, - L"Keyboard", - &Context, - DefaultProcessEntry, - NULL) == -1) - { - DestroyGenericList(List, TRUE); - return NULL; - } - - return List; -} - - -ULONG -GetDefaultLanguageIndex(VOID) -{ - return DefaultLanguageIndex; -} - -typedef struct _LANG_ENTRY_PARAM -{ - ULONG uIndex; - PWCHAR DefaultLanguage; -} LANG_ENTRY_PARAM, *PLANG_ENTRY_PARAM; - -static UCHAR -NTAPI -ProcessLangEntry( - IN PCWSTR KeyName, - IN PCWSTR KeyValue, - OUT PVOID* UserData, - OUT PBOOLEAN Current, - IN PVOID Parameter OPTIONAL) -{ - PLANG_ENTRY_PARAM LangEntryParam = (PLANG_ENTRY_PARAM)Parameter; - - PGENENTRY GenEntry; - SIZE_T IdSize, ValueSize; - - if (!IsLanguageAvailable(KeyName)) - { - /* The specified language is unavailable, skip the entry */ - return 2; - } - - IdSize = (wcslen(KeyName) + 1) * sizeof(WCHAR); - ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR); - - GenEntry = RtlAllocateHeap(ProcessHeap, 0, - sizeof(*GenEntry) + IdSize + ValueSize); - if (GenEntry == NULL) - { - /* Failure, stop enumeration */ - DPRINT1("RtlAllocateHeap() failed\n"); - return 0; - } - - GenEntry->Id = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry)); - GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry) + IdSize); - RtlStringCbCopyW((PWSTR)GenEntry->Id, IdSize, KeyName); - RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue); - - *UserData = GenEntry; - *Current = FALSE; - - if (!_wcsicmp(KeyName, LangEntryParam->DefaultLanguage)) - DefaultLanguageIndex = LangEntryParam->uIndex; - - LangEntryParam->uIndex++; - - /* Add the entry */ - return 1; -} - -PGENERIC_LIST -CreateLanguageList( - IN HINF InfFile, - OUT PWSTR DefaultLanguage) -{ - PGENERIC_LIST List; - INFCONTEXT Context; - PCWSTR KeyValue; - - LANG_ENTRY_PARAM LangEntryParam; - - LangEntryParam.uIndex = 0; - LangEntryParam.DefaultLanguage = DefaultLanguage; - - /* Get default language id */ - if (!SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLanguage", &Context)) - return NULL; - - if (!INF_GetData(&Context, NULL, &KeyValue)) - return NULL; - - wcscpy(DefaultLanguage, KeyValue); - - List = CreateGenericList(); - if (List == NULL) - return NULL; - - if (AddEntriesFromInfSection(List, - InfFile, - L"Language", - &Context, - ProcessLangEntry, - &LangEntryParam) == -1) - { - DestroyGenericList(List, TRUE); - return NULL; - } - - /* Only one language available, make it the default one */ - if (LangEntryParam.uIndex == 1) - { - DefaultLanguageIndex = 0; - wcscpy(DefaultLanguage, - ((PGENENTRY)GetListEntryData(GetFirstListEntry(List)))->Id); - } - - return List; -} - - -PGENERIC_LIST -CreateKeyboardLayoutList( - IN HINF InfFile, - IN PCWSTR LanguageId, - OUT PWSTR DefaultKBLayout) -{ - PGENERIC_LIST List; - INFCONTEXT Context; - PCWSTR KeyValue; - const MUI_LAYOUTS* LayoutsList; - ULONG uIndex = 0; - - /* Get default layout id */ - if (!SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLayout", &Context)) - return NULL; - - if (!INF_GetData(&Context, NULL, &KeyValue)) - return NULL; - - wcscpy(DefaultKBLayout, KeyValue); - - List = CreateGenericList(); - if (List == NULL) - return NULL; - - LayoutsList = MUIGetLayoutsList(LanguageId); - - do - { - // NOTE: See https://svn.reactos.org/svn/reactos?view=revision&revision=68354 - if (AddEntriesFromInfSection(List, - InfFile, - L"KeyboardLayout", - &Context, - DefaultProcessEntry, - DefaultKBLayout) == -1) - { - DestroyGenericList(List, TRUE); - return NULL; - } - - uIndex++; - - } while (LayoutsList[uIndex].LangID != 0); - - /* Check whether some keyboard layouts have been found */ - /* FIXME: Handle this case */ - if (GetNumberOfListEntries(List) == 0) - { - DPRINT1("No keyboard layouts have been found\n"); - DestroyGenericList(List, TRUE); - return NULL; - } - - return List; -} - - BOOLEAN ProcessKeyboardLayoutRegistry( - _In_ PCWSTR pszLayoutId, - _In_ PCWSTR LanguageId) + _In_ KLID LayoutId, + _In_ LANGID LanguageId) { - KLID LayoutId; const MUI_LAYOUTS* LayoutsList; MUI_LAYOUTS NewLayoutsList[20]; // HACK: Hardcoded fixed size "20" is a hack. Please verify against lang/*.h ULONG uIndex; ULONG uOldPos = 0; - LayoutId = (KLID)(pszLayoutId ? wcstoul(pszLayoutId, NULL, 16) : 0); - if (LayoutId == 0) - return FALSE; - LayoutsList = MUIGetLayoutsList(LanguageId); /* If the keyboard layout is already at the top of the list, we are done */ if (LayoutsList[0].LayoutID == LayoutId) return TRUE; + // TODO: Shouldn't we add it to the registry as well? + // Note that AddKeyboardLayouts() also calls AddKbLayoutsToRegistry(). /* Otherwise, move it up to the top of the list */ for (uIndex = 1; LayoutsList[uIndex].LangID != 0; ++uIndex) @@ -1310,7 +1668,7 @@ ProcessKeyboardLayoutRegistry( #if 0 BOOLEAN ProcessKeyboardLayoutFiles( - IN PGENERIC_LIST List) + IN PGENERIC_LIST List) // _In_ PCWSTR KeyboardDriver { return TRUE; } diff --git a/base/setup/lib/settings.h b/base/setup/lib/settings.h index da6c7f2acd2..fbfc3f12c83 100644 --- a/base/setup/lib/settings.h +++ b/base/setup/lib/settings.h @@ -26,20 +26,105 @@ #pragma once -/* Settings entries with simple 1:1 mapping */ +/* Setting entries with simple 1:1 mapping */ typedef struct _GENENTRY { - PCWSTR Id; + union + { + PCWSTR Str; + ULONG_PTR Ul; + } Id; PCWSTR Value; } GENENTRY, *PGENENTRY; +#if 1 PGENERIC_LIST CreateComputerTypeList( - IN HINF InfFile); + _In_ HINF InfFile); PGENERIC_LIST CreateDisplayDriverList( - IN HINF InfFile); + _In_ HINF InfFile); + +PGENERIC_LIST +CreateKeyboardDriverList( + _In_ HINF InfFile); + +PGENERIC_LIST +CreateLanguageList( + _In_ HINF InfFile, + _Inout_ LANGID* DefaultLanguage); + +PGENERIC_LIST +CreateKeyboardLayoutList( + _In_ HINF InfFile, + _In_ LANGID LanguageId, + _Out_ KLID* DefaultKBLayout); +#endif + + +/** + * @brief + * Callback type for enumerating "Name=Value" entries from INF section. + * + * @param[in] KeyName + * The name of the key. + * + * @param[in] KeyValue + * The optional value of the key. + * + * @param[in] Parameter + * Optional parameter context for the callback. + * + * @return + * 0x00: Failure, stop the enumeration; + * 0x01: Add the entry and continue the enumeration; + * 0x02: Skip the entry but continue the enumeration. + **/ +typedef UCHAR +(NTAPI *PENUM_ENTRY_PROC)( + _In_ PCWSTR KeyName, + _In_opt_ PCWSTR KeyValue, + /**/_In_ ULONG_PTR DefaultEntry,/**/ // PCWSTR DefaultKeyName + _In_opt_ PVOID Parameter); + +BOOLEAN +EnumComputerTypeEntries( + _In_ HINF InfFile, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter); + +BOOLEAN +EnumDisplayDriverEntries( + _In_ HINF InfFile, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter); + +BOOLEAN +EnumKeyboardDriverEntries( + _In_ HINF InfFile, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter); + +BOOLEAN +EnumLanguageEntries( + _In_ HINF InfFile, + _Out_ LANGID* DefaultLanguage, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter); + +BOOLEAN +EnumKeyboardLayoutEntries( + _In_ HINF InfFile, + _In_ LANGID LanguageId, + _Out_ KLID* DefaultKBLayout, + _In_ PENUM_ENTRY_PROC EnumEntryProc, + _In_opt_ PVOID Parameter); + + +ULONG +GetDefaultLanguageIndex(VOID); + BOOLEAN ProcessComputerFiles( @@ -52,28 +137,10 @@ ProcessDisplayRegistry( _In_ HINF InfFile, _In_ PCWSTR DisplayType); -PGENERIC_LIST -CreateKeyboardDriverList( - IN HINF InfFile); - -PGENERIC_LIST -CreateKeyboardLayoutList( - IN HINF InfFile, - IN PCWSTR LanguageId, - OUT PWSTR DefaultKBLayout); - -PGENERIC_LIST -CreateLanguageList( - IN HINF InfFile, - OUT PWSTR DefaultLanguage); - -ULONG -GetDefaultLanguageIndex(VOID); - BOOLEAN ProcessKeyboardLayoutRegistry( - _In_ PCWSTR pszLayoutId, - _In_ PCWSTR LanguageId); + _In_ KLID LayoutId, + _In_ LANGID LanguageId); #if 0 BOOLEAN @@ -83,7 +150,7 @@ ProcessKeyboardLayoutFiles( BOOLEAN ProcessLocaleRegistry( - _In_ PCWSTR LanguageId); + _In_ LCID LocaleId); BOOLEAN SetGeoID( diff --git a/base/setup/lib/setuplib.c b/base/setup/lib/setuplib.c index 632db24ec29..8344a5b045d 100644 --- a/base/setup/lib/setuplib.c +++ b/base/setup/lib/setuplib.c @@ -50,7 +50,7 @@ CheckUnattendedSetup( UnattendInf = SpInfOpenInfFile(UnattendInfPath, NULL, INF_STYLE_OLDNT, - pSetupData->LanguageId, + LANGIDFROMLCID(pSetupData->LocaleID), &ErrorLine); if (UnattendInf == INVALID_HANDLE_VALUE) { @@ -179,10 +179,7 @@ CheckUnattendedSetup( { if (INF_GetData(&Context, NULL, &Value)) { - LONG Id = wcstol(Value, NULL, 16); - RtlStringCchPrintfW(pSetupData->LocaleID, - ARRAYSIZE(pSetupData->LocaleID), - L"%08lx", Id); + pSetupData->LocaleID = (LCID)wcstoul(Value, NULL, 16); INF_FreeData(Value); } } @@ -572,7 +569,7 @@ LoadSetupInf( SpInfOpenInfFile(FileNameBuffer, NULL, INF_STYLE_WIN4, - pSetupData->LanguageId, + LANGIDFROMLCID(pSetupData->LocaleID), &ErrorLine); if (pSetupData->SetupInf == INVALID_HANDLE_VALUE) return ERROR_LOAD_TXTSETUPSIF; @@ -1096,41 +1093,6 @@ VOID FinishSetup( IN OUT PUSETUP_DATA pSetupData) { - /* Destroy the computer settings list */ - if (pSetupData->ComputerList != NULL) - { - DestroyGenericList(pSetupData->ComputerList, TRUE); - pSetupData->ComputerList = NULL; - } - - /* Destroy the display settings list */ - if (pSetupData->DisplayList != NULL) - { - DestroyGenericList(pSetupData->DisplayList, TRUE); - pSetupData->DisplayList = NULL; - } - - /* Destroy the keyboard settings list */ - if (pSetupData->KeyboardList != NULL) - { - DestroyGenericList(pSetupData->KeyboardList, TRUE); - pSetupData->KeyboardList = NULL; - } - - /* Destroy the keyboard layout list */ - if (pSetupData->LayoutList != NULL) - { - DestroyGenericList(pSetupData->LayoutList, TRUE); - pSetupData->LayoutList = NULL; - } - - /* Destroy the languages list */ - if (pSetupData->LanguageList != NULL) - { - DestroyGenericList(pSetupData->LanguageList, FALSE); - pSetupData->LanguageList = NULL; - } - /* Close the Setup INF */ SpInfCloseInfFile(pSetupData->SetupInf); } @@ -1148,7 +1110,6 @@ UpdateRegistry( /**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */ /**/IN PPARTLIST PartitionList, /* HACK HACK! */ /**/IN WCHAR DestinationDriveLetter, /* HACK HACK! */ - /**/IN PCWSTR SelectedLanguageId, /* HACK HACK! */ IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL) { @@ -1161,6 +1122,11 @@ UpdateRegistry( BOOLEAN Success; BOOLEAN ShouldRepairRegistry = FALSE; BOOLEAN Delete; + LANGID SelectedLanguageId = LANGIDFROMLCID(pSetupData->LocaleID); + +__debugbreak(); + +__debugbreak(); if (RepairUpdateFlag) { @@ -1274,7 +1240,7 @@ DoUpdate: if (!ImportRegistryFile(pSetupData->SourcePath.Buffer, File, Section, - pSetupData->LanguageId, Delete)) + LANGIDFROMLCID(pSetupData->LocaleID), Delete)) { DPRINT1("Importing %S failed\n", File); INF_FreeData(File); @@ -1288,14 +1254,6 @@ DoUpdate: { /* See the explanation for this test above */ - PGENERIC_LIST_ENTRY Entry; - PCWSTR LanguageId; // LocaleID; - - Entry = GetCurrentListEntry(pSetupData->DisplayList); - ASSERT(Entry); - pSetupData->DisplayType = ((PGENENTRY)GetListEntryData(Entry))->Id; - ASSERT(pSetupData->DisplayType); - /* Update display registry settings */ if (StatusRoutine) StatusRoutine(DisplaySettingsUpdate); if (!ProcessDisplayRegistry(pSetupData->SetupInf, pSetupData->DisplayType)) @@ -1304,14 +1262,9 @@ DoUpdate: goto Cleanup; } - Entry = GetCurrentListEntry(pSetupData->LanguageList); - ASSERT(Entry); - LanguageId = ((PGENENTRY)GetListEntryData(Entry))->Id; - ASSERT(LanguageId); - /* Set the locale */ if (StatusRoutine) StatusRoutine(LocaleSettingsUpdate); - if (!ProcessLocaleRegistry(/*pSetupData->*/LanguageId)) + if (!ProcessLocaleRegistry(pSetupData->LocaleID)) { ErrorNumber = ERROR_UPDATE_LOCALESETTINGS; goto Cleanup; @@ -1327,12 +1280,7 @@ DoUpdate: if (!IsUnattendedSetup) { - Entry = GetCurrentListEntry(pSetupData->LayoutList); - ASSERT(Entry); - pSetupData->LayoutId = ((PGENENTRY)GetListEntryData(Entry))->Id; - ASSERT(pSetupData->LayoutId); - - /* Update keyboard layout settings with user-overridden values */ + /* Update keyboard layout settings with user overriden values */ // FIXME: Wouldn't it be better to do it all at once // with the AddKeyboardLayouts() step? if (StatusRoutine) StatusRoutine(KeybSettingsUpdate); @@ -1370,7 +1318,7 @@ DoUpdate: if (SubstSettings) { /* HACK */ - DoRegistryFontFixup(SubstSettings, wcstoul(SelectedLanguageId, NULL, 16)); + DoRegistryFontFixup(SubstSettings, SelectedLanguageId); } #endif diff --git a/base/setup/lib/setuplib.h b/base/setup/lib/setuplib.h index a69f7bba877..19ae5e35c1f 100644 --- a/base/setup/lib/setuplib.h +++ b/base/setup/lib/setuplib.h @@ -27,13 +27,13 @@ extern HANDLE ProcessHeap; #include "errorcode.h" #include "spapisup/fileqsup.h" #include "spapisup/infsupp.h" -#include "utils/linklist.h" +#include "utils/linklist.h" // FIXME: Is this still needed? #include "utils/ntverrsrc.h" // #include "utils/arcname.h" #include "utils/bldrsup.h" #include "utils/filesup.h" #include "utils/fsrec.h" -#include "utils/genlist.h" +#include "utils/genlist.h" // FIXME: May be moved to usetup only #include "utils/inicache.h" #include "utils/partinfo.h" #include "utils/partlist.h" @@ -126,24 +126,14 @@ typedef struct _USETUP_DATA LONG AutoPartition; LONG FsType; -/* Settings lists *****/ - PGENERIC_LIST ComputerList; - PGENERIC_LIST DisplayList; - PGENERIC_LIST KeyboardList; - PGENERIC_LIST LayoutList; - PGENERIC_LIST LanguageList; - /* Settings *****/ ARCHITECTURE_TYPE ArchType; //< Target architecture (MachineType) PCWSTR ComputerType; PCWSTR DisplayType; - // PCWSTR KeyboardDriver; + PCWSTR KeyboardDriver; // PCWSTR MouseDriver; - PCWSTR LayoutId; // DefaultKBLayout - -/* Other stuff *****/ - WCHAR LocaleID[9]; - LANGID LanguageId; + LCID LocaleID; // Or just LANGID LanguageId == LANGIDFROMLCID(LocaleID) ? + KLID LayoutId; // DefaultKBLayout ULONG RequiredPartitionDiskSpace; WCHAR InstallationDirectory[MAX_PATH]; @@ -241,7 +231,6 @@ UpdateRegistry( /**/IN BOOLEAN RepairUpdateFlag, /* HACK HACK! */ /**/IN PPARTLIST PartitionList, /* HACK HACK! */ /**/IN WCHAR DestinationDriveLetter, /* HACK HACK! */ - /**/IN PCWSTR SelectedLanguageId, /* HACK HACK! */ IN PREGISTRY_STATUS_ROUTINE StatusRoutine OPTIONAL, IN PFONTSUBSTSETTINGS SubstSettings OPTIONAL); diff --git a/base/setup/reactos/reactos.c b/base/setup/reactos/reactos.c index a5e1693c4df..5ff5f65c8f2 100644 --- a/base/setup/reactos/reactos.c +++ b/base/setup/reactos/reactos.c @@ -25,7 +25,6 @@ */ #include "reactos.h" -#include // For GetUserDefaultLCID() #define NTOS_MODE_USER #include @@ -914,16 +913,16 @@ DeviceDlgProc( SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData); hList = GetDlgItem(hwndDlg, IDC_COMPUTER); - InitGenericComboList(hList, pSetupData->USetupData.ComputerList, GetSettingDescription); + InitGenericComboList(hList, pSetupData->ComputerList, GetSettingDescription); hList = GetDlgItem(hwndDlg, IDC_DISPLAY); - InitGenericComboList(hList, pSetupData->USetupData.DisplayList, GetSettingDescription); + InitGenericComboList(hList, pSetupData->DisplayList, GetSettingDescription); hList = GetDlgItem(hwndDlg, IDC_KEYBOARD); - InitGenericComboList(hList, pSetupData->USetupData.KeyboardList, GetSettingDescription); + InitGenericComboList(hList, pSetupData->KeyboardList, GetSettingDescription); // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT); - // InitGenericComboList(hList, pSetupData->USetupData.LayoutList, GetSettingDescription); + // InitGenericComboList(hList, pSetupData->LayoutList, GetSettingDescription); break; } @@ -964,19 +963,19 @@ DeviceDlgProc( case PSN_WIZNEXT: /* Set the selected data */ { hList = GetDlgItem(hwndDlg, IDC_COMPUTER); - SetCurrentListEntry(pSetupData->USetupData.ComputerList, + SetCurrentListEntry(pSetupData->ComputerList, GetSelectedComboListItem(hList)); hList = GetDlgItem(hwndDlg, IDC_DISPLAY); - SetCurrentListEntry(pSetupData->USetupData.DisplayList, + SetCurrentListEntry(pSetupData->DisplayList, GetSelectedComboListItem(hList)); hList = GetDlgItem(hwndDlg, IDC_KEYBOARD); - SetCurrentListEntry(pSetupData->USetupData.KeyboardList, + SetCurrentListEntry(pSetupData->KeyboardList, GetSelectedComboListItem(hList)); // hList = GetDlgItem(hwndDlg, IDC_KEYBOARD_LAYOUT); - // SetCurrentListEntry(pSetupData->USetupData.LayoutList, + // SetCurrentListEntry(pSetupData->LayoutList, // GetSelectedComboListItem(hList)); return TRUE; @@ -1063,17 +1062,17 @@ SummaryDlgProc( SetDlgItemTextW(hwndDlg, IDC_INSTALLSOURCE, L"n/a"); SetDlgItemTextW(hwndDlg, IDC_ARCHITECTURE, L"n/a"); - GetSettingDescription(GetCurrentListEntry(pSetupData->USetupData.ComputerList), + GetSettingDescription(GetCurrentListEntry(pSetupData->ComputerList), CurrentItemText, ARRAYSIZE(CurrentItemText)); SetDlgItemTextW(hwndDlg, IDC_COMPUTER, CurrentItemText); - GetSettingDescription(GetCurrentListEntry(pSetupData->USetupData.DisplayList), + GetSettingDescription(GetCurrentListEntry(pSetupData->DisplayList), CurrentItemText, ARRAYSIZE(CurrentItemText)); SetDlgItemTextW(hwndDlg, IDC_DISPLAY, CurrentItemText); - GetSettingDescription(GetCurrentListEntry(pSetupData->USetupData.KeyboardList), + GetSettingDescription(GetCurrentListEntry(pSetupData->KeyboardList), CurrentItemText, ARRAYSIZE(CurrentItemText)); SetDlgItemTextW(hwndDlg, IDC_KEYBOARD, CurrentItemText); @@ -1997,7 +1996,6 @@ PrepareAndDoCopyThread( pSetupData->RepairUpdateFlag, pSetupData->PartitionList, InstallVolume->Info.DriveLetter, - pSetupData->SelectedLanguageId, RegistryStatus, NULL /* SubstSettings */); DBG_UNREFERENCED_PARAMETER(ErrorNumber); @@ -2348,12 +2346,10 @@ RestartDlgProc( BOOL LoadSetupData( IN OUT PSETUPDATA pSetupData) { + BOOL ret = TRUE; + LANGID NewLanguageId = pSetupData->USetupData.LocaleID; + pSetupData->PartitionList = CreatePartitionList(); - if (!pSetupData->PartitionList) - { - DPRINT1("Could not enumerate available disks; failing installation\n"); - return FALSE; - } pSetupData->NtOsInstallsList = CreateNTOSInstallationsList(pSetupData->PartitionList); if (!pSetupData->NtOsInstallsList) @@ -2361,79 +2357,20 @@ BOOL LoadSetupData( /* Load the hardware, language and keyboard layout lists */ - pSetupData->USetupData.ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf); - pSetupData->USetupData.DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf); - pSetupData->USetupData.KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf); + pSetupData->ComputerList = CreateComputerTypeList(pSetupData->USetupData.SetupInf); + pSetupData->DisplayList = CreateDisplayDriverList(pSetupData->USetupData.SetupInf); + pSetupData->KeyboardList = CreateKeyboardDriverList(pSetupData->USetupData.SetupInf); - pSetupData->USetupData.LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, pSetupData->DefaultLanguage); - - /* If not unattended, overwrite language and locale with - * the current ones of the running ReactOS instance */ - if (!IsUnattendedSetup) - { - LCID LocaleID = GetUserDefaultLCID(); - - StringCchPrintfW(pSetupData->DefaultLanguage, - _countof(pSetupData->DefaultLanguage), - L"%08lx", LocaleID); - - StringCchPrintfW(pSetupData->USetupData.LocaleID, - _countof(pSetupData->USetupData.LocaleID), - L"%08lx", LocaleID); - } + pSetupData->LanguageList = CreateLanguageList(pSetupData->USetupData.SetupInf, &NewLanguageId); /* new part */ - pSetupData->SelectedLanguageId = pSetupData->DefaultLanguage; - wcscpy(pSetupData->DefaultLanguage, pSetupData->USetupData.LocaleID); // FIXME: In principle, only when unattended. - pSetupData->USetupData.LanguageId = (LANGID)(wcstol(pSetupData->SelectedLanguageId, NULL, 16) & 0xFFFF); + pSetupData->USetupData.LocaleID = (LCID)NewLanguageId; - pSetupData->USetupData.LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf, - pSetupData->SelectedLanguageId, - pSetupData->DefaultKBLayout); + pSetupData->LayoutList = CreateKeyboardLayoutList(pSetupData->USetupData.SetupInf, + LANGIDFROMLCID(pSetupData->USetupData.LocaleID), + &pSetupData->USetupData.LayoutId); - /* If not unattended, overwrite keyboard layout with - * the current one of the running ReactOS instance */ - if (!IsUnattendedSetup) - { - C_ASSERT(_countof(pSetupData->DefaultKBLayout) >= KL_NAMELENGTH); - /* If the call fails, keep the default already stored in the buffer */ - GetKeyboardLayoutNameW(pSetupData->DefaultKBLayout); - } - - /* Change the default entries in the language and keyboard layout lists */ - { - PGENERIC_LIST LanguageList = pSetupData->USetupData.LanguageList; - PGENERIC_LIST LayoutList = pSetupData->USetupData.LayoutList; - PGENERIC_LIST_ENTRY ListEntry; - - /* Search for default language */ - for (ListEntry = GetFirstListEntry(LanguageList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - PCWSTR LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!_wcsicmp(pSetupData->DefaultLanguage, LocaleId)) - { - DPRINT("found %S in LanguageList\n", LocaleId); - SetCurrentListEntry(LanguageList, ListEntry); - break; - } - } - - /* Search for default layout */ - for (ListEntry = GetFirstListEntry(LayoutList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!_wcsicmp(pSetupData->DefaultKBLayout, pszLayoutId)) - { - DPRINT("Found %S in LayoutList\n", pszLayoutId); - SetCurrentListEntry(LayoutList, ListEntry); - break; - } - } - } - - return TRUE; + return ret; } VOID diff --git a/base/setup/reactos/reactos.h b/base/setup/reactos/reactos.h index 8beffc4c86a..098870debd9 100644 --- a/base/setup/reactos/reactos.h +++ b/base/setup/reactos/reactos.h @@ -149,17 +149,16 @@ typedef struct _SETUPDATA PNTOS_INSTALLATION CurrentInstallation; PGENERIC_LIST NtOsInstallsList; +/* Settings lists *****/ // FIXME: HACKHACK! Remove these! + PGENERIC_LIST ComputerList; + PGENERIC_LIST DisplayList; + PGENERIC_LIST KeyboardList; + PGENERIC_LIST LanguageList; + PGENERIC_LIST LayoutList; /* Settings */ LONG DestPartSize; // if partition doesn't exist, size of partition - /* txtsetup.sif data */ - // LONG DefaultLang; // default language (table index) - // LONG DefaultKBLayout; // default keyboard layout (table index) - PCWSTR SelectedLanguageId; - WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList - WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList - } SETUPDATA, *PSETUPDATA; extern HANDLE ProcessHeap; diff --git a/base/setup/usetup/mui.c b/base/setup/usetup/mui.c index afe99d91ab3..dc5d2568493 100644 --- a/base/setup/usetup/mui.c +++ b/base/setup/usetup/mui.c @@ -51,53 +51,50 @@ CHAR CharDoubleUpperRightCorner = 0xBB; /* double upper right corner */ CHAR CharDoubleLowerLeftCorner = 0xC8; /* double lower left corner */ CHAR CharDoubleLowerRightCorner = 0xBC; /* double lower right corner */ + +LANGID SelectedLanguageId; + static ULONG FindLanguageIndex(VOID) { ULONG lngIndex = 0; - if (SelectedLanguageId == NULL) + if (SelectedLanguageId == 0) { /* Default to en-US */ - return 0; // FIXME!! - // SelectedLanguageId = L"00000409"; + return 0; // FIXME!! + // SelectedLanguageId = 0x0409; } while (ResourceList[lngIndex].MuiPages != NULL) { - if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0) - { + if (ResourceList[lngIndex].LanguageID == SelectedLanguageId) return lngIndex; - } - - lngIndex++; + ++lngIndex; } return 0; } - #if 0 BOOLEAN IsLanguageAvailable( - PWCHAR LanguageId) + _In_ LANGID LanguageId) { ULONG lngIndex = 0; while (ResourceList[lngIndex].MuiPages != NULL) { - if (_wcsicmp(ResourceList[lngIndex].LanguageID, LanguageId) == 0) + if (ResourceList[lngIndex].LanguageID == LanguageId) return TRUE; - - lngIndex++; + ++lngIndex; } return FALSE; } #endif - static const MUI_ENTRY * FindMUIEntriesOfPage( @@ -105,9 +102,9 @@ FindMUIEntriesOfPage( { ULONG muiIndex = 0; ULONG lngIndex; - const MUI_PAGE * Pages = NULL; + const MUI_PAGE* Pages; - lngIndex = max(FindLanguageIndex(), 0); + lngIndex = FindLanguageIndex(); Pages = ResourceList[lngIndex].MuiPages; while (Pages[muiIndex].MuiEntry != NULL) @@ -125,7 +122,7 @@ static const MUI_ERROR * FindMUIErrorEntries(VOID) { - ULONG lngIndex = max(FindLanguageIndex(), 0); + ULONG lngIndex = FindLanguageIndex(); return ResourceList[lngIndex].MuiErrors; } @@ -133,11 +130,20 @@ static const MUI_STRING * FindMUIStringEntries(VOID) { - ULONG lngIndex = max(FindLanguageIndex(), 0); + ULONG lngIndex = FindLanguageIndex(); return ResourceList[lngIndex].MuiStrings; } +#if 0 +VOID +MUISetCurrentLanguage( + _In_ LANGID LanguageId) +{ + SelectedLanguageId = LanguageId; +} +#endif + VOID MUIClearPage( IN ULONG page) @@ -267,7 +273,8 @@ MUIGetString( } } - sprintf(szErr, "Error: failed find string id %lu for language index %lu\n", Number, FindLanguageIndex()); + sprintf(szErr, "Error: failed find string id %lu for language index %lu\n", + Number, FindLanguageIndex()); PopupError(szErr, NULL, @@ -540,10 +547,9 @@ SetConsoleCodePage(VOID) #if 0 ULONG lngIndex = 0; - while (ResourceList[lngIndex].MuiPages != NULL) { - if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0) + if (ResourceList[lngIndex].LanguageID == SelectedLanguageId) { wCodePage = ResourceList[lngIndex].OEMCPage; SetConsoleOutputCP(wCodePage); diff --git a/base/setup/usetup/mui.h b/base/setup/usetup/mui.h index b2b2dc179a4..d4c390f48e1 100644 --- a/base/setup/usetup/mui.h +++ b/base/setup/usetup/mui.h @@ -29,7 +29,7 @@ typedef struct typedef struct { - PCWSTR LanguageID; + LCID LanguageID; // LocaleID; PCWSTR LanguageDescriptor; const MUI_PAGE * MuiPages; const MUI_ERROR * MuiErrors; @@ -39,7 +39,14 @@ typedef struct #if 0 BOOLEAN IsLanguageAvailable( - PWCHAR LanguageId); + _In_ LANGID LanguageId); +#endif + +extern LANGID SelectedLanguageId; +#if 0 +VOID +MUISetCurrentLanguage( + _In_ LANGID LanguageId); #endif VOID diff --git a/base/setup/usetup/muilanguages.h b/base/setup/usetup/muilanguages.h index 6af97f7d66e..f8236ecd53e 100644 --- a/base/setup/usetup/muilanguages.h +++ b/base/setup/usetup/muilanguages.h @@ -413,432 +413,432 @@ const MUI_LANGUAGE_RESOURCE ResourceList[] = { - /* Lang ID, Language Name, Page strings, Error strings, Other strings */ + /* LangID, Language Name, Page strings, Error strings, Other strings */ #ifdef LANGUAGE_AF_ZA - {L"00000436", L"Afrikaans", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000436, L"Afrikaans", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_SQ_AL - {L"0000041C", L"Albanian (Albania)", sqALPages, sqALErrorEntries, sqALStrings}, + {0x0000041C, L"Albanian (Albania)", sqALPages, sqALErrorEntries, sqALStrings}, #endif #ifdef LANGUAGE_AR_SA - {L"00000401", L"Arabic (Saudi Arabia)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000401, L"Arabic (Saudi Arabia)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_IQ - {L"00000801", L"Arabic (Iraq)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000801, L"Arabic (Iraq)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_EG - {L"00000C01", L"Arabic (Egypt)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000C01, L"Arabic (Egypt)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_LY - {L"00001001", L"Arabic (Libya)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001001, L"Arabic (Libya)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_DZ - {L"00001401", L"Arabic (Algeria)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001401, L"Arabic (Algeria)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_MA - {L"00001801", L"Arabic (Morocco)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001801, L"Arabic (Morocco)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_TN - {L"00001C01", L"Arabic (Tunisia)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001C01, L"Arabic (Tunisia)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_OM - {L"00002001", L"Arabic (Oman)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002001, L"Arabic (Oman)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_YE - {L"00002401", L"Arabic (Yemen)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002401, L"Arabic (Yemen)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_SY - {L"00002801", L"Arabic (Syria)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002801, L"Arabic (Syria)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_JO - {L"00002C01", L"Arabic (Jordan)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002C01, L"Arabic (Jordan)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_LB - {L"00003001", L"Arabic (Lebanon)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003001, L"Arabic (Lebanon)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_KW - {L"00003401", L"Arabic (Kuwait)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003401, L"Arabic (Kuwait)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_AE - {L"00003801", L"Arabic (U.A.E.)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003801, L"Arabic (U.A.E.)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_BH - {L"00003C01", L"Arabic (Bahrain)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003C01, L"Arabic (Bahrain)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AR_QA - {L"00004001", L"Arabic (Qatar)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00004001, L"Arabic (Qatar)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_HY_AM - {L"0000042B", L"Armenian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000042B, L"Armenian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AZ_AZ - {L"0000082C", L"Azeri (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000082C, L"Azeri (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_AZ_AZ - {L"0000042C", L"Azeri (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000042C, L"Azeri (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EU_ES - {L"0000042D", L"Basque", euESPages, euESErrorEntries, euESStrings}, + {0x0000042D, L"Basque", euESPages, euESErrorEntries, euESStrings}, #endif #ifdef LANGUAGE_BE_BY - {L"00000423", L"Belarusian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000423, L"Belarusian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_BN_BD - {L"00000845", L"Bengali (Bangladesh)", bnBDPages, bnBDErrorEntries, bnBDStrings}, + {0x00000845, L"Bengali (Bangladesh)", bnBDPages, bnBDErrorEntries, bnBDStrings}, #endif #ifdef LANGUAGE_BN_IN - {L"00000445", L"Bengali (India)", bnBDPages, bnBDErrorEntries, bnBDStrings}, + {0x00000445, L"Bengali (India)", bnBDPages, bnBDErrorEntries, bnBDStrings}, #endif #ifdef LANGUAGE_BG_BG - {L"00000402", L"Bulgarian", bgBGPages, bgBGErrorEntries, bgBGStrings}, + {0x00000402, L"Bulgarian", bgBGPages, bgBGErrorEntries, bgBGStrings}, #endif #ifdef LANGUAGE_MY_MM - {L"00000455", L"Burmese", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000455, L"Burmese", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_CA_ES - {L"00000403", L"Catalan", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000403, L"Catalan", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZH_TW - {L"00000404", L"Chinese (Taiwan)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000404, L"Chinese (Taiwan)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZH_CN - {L"00000804", L"Chinese (PRC)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000804, L"Chinese (PRC)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZH_HK - {L"00000C04", L"Chinese (Hong Kong S.A.R.)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000C04, L"Chinese (Hong Kong S.A.R.)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZH_SG - {L"00001004", L"Chinese (Singapore)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001004, L"Chinese (Singapore)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZH_MO - {L"00001404", L"Chinese (Macau S.A.R.)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001404, L"Chinese (Macau S.A.R.)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_HR_HR - {L"0000041A", L"Croatian", hrHRPages, hrHRErrorEntries, hrHRStrings}, + {0x0000041A, L"Croatian", hrHRPages, hrHRErrorEntries, hrHRStrings}, #endif #ifdef LANGUAGE_CS_CZ - {L"00000405", L"Czech", csCZPages, csCZErrorEntries, csCZStrings}, + {0x00000405, L"Czech", csCZPages, csCZErrorEntries, csCZStrings}, #endif #ifdef LANGUAGE_DA_DK - {L"00000406", L"Danish", daDKPages, daDKErrorEntries, daDKStrings}, + {0x00000406, L"Danish", daDKPages, daDKErrorEntries, daDKStrings}, #endif #ifdef LANGUAGE_DV_MV - {L"00000465", L"Dhivehi (Maldives)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000465, L"Dhivehi (Maldives)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_NL_NL - {L"00000413", L"Dutch (Netherlands)", nlNLPages, nlNLErrorEntries, nlNLStrings}, + {0x00000413, L"Dutch (Netherlands)", nlNLPages, nlNLErrorEntries, nlNLStrings}, #endif #ifdef LANGUAGE_NL_BE - {L"00000813", L"Dutch (Belgium)", nlNLPages, nlNLErrorEntries, nlNLStrings}, + {0x00000813, L"Dutch (Belgium)", nlNLPages, nlNLErrorEntries, nlNLStrings}, #endif #ifdef LANGUAGE_EN_US - {L"00000409", L"English (United States)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000409, L"English (United States)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_GB - {L"00000809", L"English (United Kingdom)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000809, L"English (United Kingdom)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_AU - {L"00000C09", L"English (Australia)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000C09, L"English (Australia)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_CA - {L"00001009", L"English (Canada)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001009, L"English (Canada)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_NZ - {L"00001409", L"English (New Zealand)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001409, L"English (New Zealand)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_IE - {L"00001809", L"English (Ireland)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001809, L"English (Ireland)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_ZA - {L"00001C09", L"English (South Africa)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00001C09, L"English (South Africa)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_JM - {L"00002009", L"English (Jamaica)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002009, L"English (Jamaica)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_CB - {L"00002409", L"English (Caribbean)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002409, L"English (Caribbean)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_BZ - {L"00002809", L"English (Belize)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002809, L"English (Belize)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_TT - {L"00002C09", L"English (Trinidad)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00002C09, L"English (Trinidad)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_ZW - {L"00003009", L"English (Zimbabwe)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003009, L"English (Zimbabwe)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EN_PH - {L"00003409", L"English (Philippines)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00003409, L"English (Philippines)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_EO_AA - {L"0000048F", L"Esperanto", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000048F, L"Esperanto", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ET_EE - {L"00000425", L"Estonian", etEEPages, etEEErrorEntries, etEEStrings}, + {0x00000425, L"Estonian", etEEPages, etEEErrorEntries, etEEStrings}, #endif #ifdef LANGUAGE_FO_FO - {L"00000438", L"Faeroese", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000438, L"Faeroese", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_FA_IR - {L"00000429", L"Farsi", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000429, L"Farsi", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_FI_FI - {L"0000040B", L"Finnish", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000040B, L"Finnish", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_FR_CA - {L"00000C0C", L"French (Canada)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x00000C0C, L"French (Canada)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_FR_FR - {L"0000040C", L"French (France)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x0000040C, L"French (France)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_FR_BE - {L"0000080C", L"French (Belgium)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x0000080C, L"French (Belgium)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_FR_CH - {L"0000100C", L"French (Switzerland)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x0000100C, L"French (Switzerland)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_FR_LU - {L"0000140C", L"French (Luxembourg)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x0000140C, L"French (Luxembourg)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_FR_MC - {L"0000180C", L"French (Monaco)", frFRPages, frFRErrorEntries, frFRStrings}, + {0x0000180C, L"French (Monaco)", frFRPages, frFRErrorEntries, frFRStrings}, #endif #ifdef LANGUAGE_GL_ES - {L"00000456", L"Galician (Spain)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000456, L"Galician (Spain)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_KA_GE - {L"00000437", L"Georgian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000437, L"Georgian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_DE_DE - {L"00000407", L"German (Germany)", deDEPages, deDEErrorEntries, deDEStrings}, + {0x00000407, L"German (Germany)", deDEPages, deDEErrorEntries, deDEStrings}, #endif #ifdef LANGUAGE_DE_CH - {L"00000807", L"German (Switzerland)", deDEPages, deDEErrorEntries, deDEStrings}, + {0x00000807, L"German (Switzerland)", deDEPages, deDEErrorEntries, deDEStrings}, #endif #ifdef LANGUAGE_DE_AT - {L"00000C07", L"German (Austria)", deDEPages, deDEErrorEntries, deDEStrings}, + {0x00000C07, L"German (Austria)", deDEPages, deDEErrorEntries, deDEStrings}, #endif #ifdef LANGUAGE_DE_LU - {L"00001007", L"German (Luxembourg)", deDEPages, deDEErrorEntries, deDEStrings}, + {0x00001007, L"German (Luxembourg)", deDEPages, deDEErrorEntries, deDEStrings}, #endif #ifdef LANGUAGE_DE_LI - {L"00001407", L"German (Liechtenstein)", deDEPages, deDEErrorEntries, deDEStrings}, + {0x00001407, L"German (Liechtenstein)", deDEPages, deDEErrorEntries, deDEStrings}, #endif #ifdef LANGUAGE_EL_GR - {L"00000408", L"Greek", elGRPages, elGRErrorEntries, elGRStrings}, + {0x00000408, L"Greek", elGRPages, elGRErrorEntries, elGRStrings}, #endif #ifdef LANGUAGE_GU_IN - {L"00000447", L"Gujarati (India)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000447, L"Gujarati (India)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_HE_IL - {L"0000040D", L"Hebrew", heILPages, heILErrorEntries, heILStrings}, + {0x0000040D, L"Hebrew", heILPages, heILErrorEntries, heILStrings}, #endif #ifdef LANGUAGE_HI_IN - {L"00000439", L"Hindi", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000439, L"Hindi", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_HU_HU - {L"0000040E", L"Hungarian", huHUPages, huHUErrorEntries, huHUStrings}, + {0x0000040E, L"Hungarian", huHUPages, huHUErrorEntries, huHUStrings}, #endif #ifdef LANGUAGE_IS_IS - {L"0000040F", L"Icelandic", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000040F, L"Icelandic", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ID_ID - {L"00000421", L"Indonesian", idIDPages, idIDErrorEntries, idIDStrings}, + {0x00000421, L"Indonesian", idIDPages, idIDErrorEntries, idIDStrings}, #endif #ifdef LANGUAGE_IT_IT - {L"00000410", L"Italian (Italy)", itITPages, itITErrorEntries, itITStrings}, + {0x00000410, L"Italian (Italy)", itITPages, itITErrorEntries, itITStrings}, #endif #ifdef LANGUAGE_IT_CH - {L"00000810", L"Italian (Switzerland)", itITPages, itITErrorEntries, itITStrings}, + {0x00000810, L"Italian (Switzerland)", itITPages, itITErrorEntries, itITStrings}, #endif #ifdef LANGUAGE_JA_JP - {L"00000411", L"Japanese", jaJPPages, jaJPErrorEntries, jaJPStrings}, + {0x00000411, L"Japanese", jaJPPages, jaJPErrorEntries, jaJPStrings}, #endif #ifdef LANGUAGE_KN_IN - {L"0000044B", L"Kannada (India)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000044B, L"Kannada (India)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_KK_KZ - {L"0000043F", L"Kazakh", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000043F, L"Kazakh", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_KOK_IN - {L"00000457", L"Konkani", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000457, L"Konkani", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_KO_KR - {L"00000412", L"Korean", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000412, L"Korean", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_KY_KG - {L"00000440", L"Kyrgyz (Kyrgyzstan)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000440, L"Kyrgyz (Kyrgyzstan)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_LV_LV - {L"00000426", L"Latvian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000426, L"Latvian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_LT_LT - {L"00000427", L"Lithuanian", ltLTPages, ltLTErrorEntries, ltLTStrings}, + {0x00000427, L"Lithuanian", ltLTPages, ltLTErrorEntries, ltLTStrings}, #endif #ifdef LANGUAGE_MK_MK - {L"0000042F", L"FYRO Macedonian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000042F, L"FYRO Macedonian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_MS_BN - {L"0000083E", L"Malay (Brunei Darussalam)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000083E, L"Malay (Brunei Darussalam)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_MS_MY - {L"0000043E", L"Malay (Malaysia)", msMYPages, msMYErrorEntries, msMYStrings}, + {0x0000043E, L"Malay (Malaysia)", msMYPages, msMYErrorEntries, msMYStrings}, #endif #ifdef LANGUAGE_MR_IN - {L"0000044E", L"Marathi", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000044E, L"Marathi", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_MN_MN - {L"00000450", L"Mongolian (Mongolia)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000450, L"Mongolian (Mongolia)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_NB_NO - {L"00000414", L"Norwegian (Bokmal)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000414, L"Norwegian (Bokmal)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_NN_NO - {L"00000814", L"Norwegian (Nynorsk)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000814, L"Norwegian (Nynorsk)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_PL_PL - {L"00000415", L"Polish", plPLPages, plPLErrorEntries, plPLStrings}, + {0x00000415, L"Polish", plPLPages, plPLErrorEntries, plPLStrings}, #endif #ifdef LANGUAGE_PT_BR - {L"00000416", L"Portuguese (Brazil)", ptBRPages, ptBRErrorEntries, ptBRStrings}, + {0x00000416, L"Portuguese (Brazil)", ptBRPages, ptBRErrorEntries, ptBRStrings}, #endif #ifdef LANGUAGE_PT_PT - {L"00000816", L"Portuguese (Portugal)", ptPTPages, ptPTErrorEntries, ptPTStrings}, + {0x00000816, L"Portuguese (Portugal)", ptPTPages, ptPTErrorEntries, ptPTStrings}, #endif #ifdef LANGUAGE_PA_IN - {L"00000446", L"Punjabi (India)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000446, L"Punjabi (India)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_RO_RO - {L"00000418", L"Romanian", roROPages, roROErrorEntries, roROStrings}, + {0x00000418, L"Romanian", roROPages, roROErrorEntries, roROStrings}, #endif #ifdef LANGUAGE_RM_CH - {L"00000417", L"Romansh", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000417, L"Romansh", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_RU_RU - {L"00000419", L"Russian", ruRUPages, ruRUErrorEntries, ruRUStrings}, + {0x00000419, L"Russian", ruRUPages, ruRUErrorEntries, ruRUStrings}, #endif #ifdef LANGUAGE_SA_IN - {L"0000044F", L"Sanskrit", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000044F, L"Sanskrit", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_SR_SP - {L"00000C1A", L"Serbian (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000C1A, L"Serbian (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_SR_SP - {L"0000081A", L"Serbian (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000081A, L"Serbian (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_SK_SK - {L"0000041B", L"Slovak", skSKPages, skSKErrorEntries, skSKStrings}, + {0x0000041B, L"Slovak", skSKPages, skSKErrorEntries, skSKStrings}, #endif #ifdef LANGUAGE_SL_SI - {L"00000424", L"Slovenian", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000424, L"Slovenian", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ES_ES - {L"0000040A", L"Spanish (Traditional Sort)", esESPages, esESErrorEntries, esESStrings}, + {0x0000040A, L"Spanish (Traditional Sort)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_MX - {L"0000080A", L"Spanish (Mexico)", esESPages, esESErrorEntries, esESStrings}, + {0x0000080A, L"Spanish (Mexico)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_ES - {L"00000C0A", L"Spanish (International Sort)", esESPages, esESErrorEntries, esESStrings}, + {0x00000C0A, L"Spanish (International Sort)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_GT - {L"0000100A", L"Spanish (Guatemala)", esESPages, esESErrorEntries, esESStrings}, + {0x0000100A, L"Spanish (Guatemala)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_CR - {L"0000140A", L"Spanish (Costa Rica)", esESPages, esESErrorEntries, esESStrings}, + {0x0000140A, L"Spanish (Costa Rica)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_PA - {L"0000180A", L"Spanish (Panama)", esESPages, esESErrorEntries, esESStrings}, + {0x0000180A, L"Spanish (Panama)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_DO - {L"00001C0A", L"Spanish (Dominican Republic)", esESPages, esESErrorEntries, esESStrings}, + {0x00001C0A, L"Spanish (Dominican Republic)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_VE - {L"0000200A", L"Spanish (Venezuela)", esESPages, esESErrorEntries, esESStrings}, + {0x0000200A, L"Spanish (Venezuela)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_CO - {L"0000240A", L"Spanish (Colombia)", esESPages, esESErrorEntries, esESStrings}, + {0x0000240A, L"Spanish (Colombia)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_PE - {L"0000280A", L"Spanish (Peru)", esESPages, esESErrorEntries, esESStrings}, + {0x0000280A, L"Spanish (Peru)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_AR - {L"00002C0A", L"Spanish (Argentina)", esESPages, esESErrorEntries, esESStrings}, + {0x00002C0A, L"Spanish (Argentina)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_EC - {L"0000300A", L"Spanish (Ecuador)", esESPages, esESErrorEntries, esESStrings}, + {0x0000300A, L"Spanish (Ecuador)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_CL - {L"0000340A", L"Spanish (Chile)", esESPages, esESErrorEntries, esESStrings}, + {0x0000340A, L"Spanish (Chile)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_UY - {L"0000380A", L"Spanish (Uruguay)", esESPages, esESErrorEntries, esESStrings}, + {0x0000380A, L"Spanish (Uruguay)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_PY - {L"00003C0A", L"Spanish (Paraguay)", esESPages, esESErrorEntries, esESStrings}, + {0x00003C0A, L"Spanish (Paraguay)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_BO - {L"0000400A", L"Spanish (Bolivia)", esESPages, esESErrorEntries, esESStrings}, + {0x0000400A, L"Spanish (Bolivia)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_SV - {L"0000440A", L"Spanish (El Salvador)", esESPages, esESErrorEntries, esESStrings}, + {0x0000440A, L"Spanish (El Salvador)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_HN - {L"0000480A", L"Spanish (Honduras)", esESPages, esESErrorEntries, esESStrings}, + {0x0000480A, L"Spanish (Honduras)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_NI - {L"00004C0A", L"Spanish (Nicaragua)", esESPages, esESErrorEntries, esESStrings}, + {0x00004C0A, L"Spanish (Nicaragua)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_ES_PR - {L"0000500A", L"Spanish (Puerto Rico)", esESPages, esESErrorEntries, esESStrings}, + {0x0000500A, L"Spanish (Puerto Rico)", esESPages, esESErrorEntries, esESStrings}, #endif #ifdef LANGUAGE_SW_KE - {L"00000441", L"Swahili", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000441, L"Swahili", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_SV_SE - {L"0000041D", L"Swedish", svSEPages, svSEErrorEntries, svSEStrings}, + {0x0000041D, L"Swedish", svSEPages, svSEErrorEntries, svSEStrings}, #endif #ifdef LANGUAGE_SV_FI - {L"0000081D", L"Swedish (Finland)", svSEPages, svSEErrorEntries, svSEStrings}, + {0x0000081D, L"Swedish (Finland)", svSEPages, svSEErrorEntries, svSEStrings}, #endif #ifdef LANGUAGE_SYR_SY - {L"0000045A", L"Syriac (Syria)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000045A, L"Syriac (Syria)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_TA_IN - {L"00000449", L"Tamil", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000449, L"Tamil", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_TT_TA - {L"00000444", L"Tatar", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000444, L"Tatar", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_TE_IN - {L"0000044A", L"Telugu (India)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000044A, L"Telugu (India)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_TH_TH - {L"0000041E", L"Thai", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000041E, L"Thai", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_TR_TR - {L"0000041F", L"Turkish", trTRPages, trTRErrorEntries, trTRStrings}, + {0x0000041F, L"Turkish", trTRPages, trTRErrorEntries, trTRStrings}, #endif #ifdef LANGUAGE_UK_UA - {L"00000422", L"Ukrainian", ukUAPages, ukUAErrorEntries, ukUAStrings}, + {0x00000422, L"Ukrainian", ukUAPages, ukUAErrorEntries, ukUAStrings}, #endif #ifdef LANGUAGE_UR_PK - {L"00000420", L"Urdu", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000420, L"Urdu", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_UZ_UZ - {L"00000443", L"Uzbek (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000443, L"Uzbek (Latin)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_UZ_UZ - {L"00000843", L"Uzbek (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000843, L"Uzbek (Cyrillic)", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_VI_VN - {L"0000042A", L"Vietnamese", enUSPages, enUSErrorEntries, enUSStrings}, + {0x0000042A, L"Vietnamese", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_WA_BE - {L"00000490", L"Walon", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000490, L"Walon", enUSPages, enUSErrorEntries, enUSStrings}, #endif #ifdef LANGUAGE_ZU_ZU - {L"00000435", L"Zulu", enUSPages, enUSErrorEntries, enUSStrings}, + {0x00000435, L"Zulu", enUSPages, enUSErrorEntries, enUSStrings}, #endif - {NULL, NULL, NULL, NULL, NULL} + {0, NULL, NULL, NULL, NULL} }; diff --git a/base/setup/usetup/usetup.c b/base/setup/usetup/usetup.c index 806353223a8..0347de30a44 100644 --- a/base/setup/usetup/usetup.c +++ b/base/setup/usetup/usetup.c @@ -63,11 +63,16 @@ static PPARTENTRY SystemPartition = NULL; #define SystemVolume (SystemPartition->Volume) -/* OTHER Stuff *****/ +/* Settings lists *****/ +PGENERIC_LIST ComputerList; +PGENERIC_LIST DisplayList; +PGENERIC_LIST KeyboardList; +PGENERIC_LIST LanguageList; +PGENERIC_LIST LayoutList; -PCWSTR SelectedLanguageId; -static WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList -static WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList + +/* OTHER Stuff *****/ +static LANGID DefaultLanguage; static BOOLEAN RepairUpdateFlag = FALSE; @@ -460,15 +465,16 @@ ConfirmQuit(PINPUT_RECORD Ir) static VOID UpdateKBLayout(VOID) { - PGENERIC_LIST_ENTRY ListEntry; KLID newLayout; - newLayout = MUIDefaultKeyboardLayout(SelectedLanguageId); + newLayout = MUIDefaultKeyboardLayout(LANGIDFROMLCID(USetupData.LocaleID)); - if (!USetupData.LayoutList) + if (!LayoutList) { - USetupData.LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, SelectedLanguageId, DefaultKBLayout); - if (!USetupData.LayoutList) + LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, + LANGIDFROMLCID(USetupData.LocaleID), + &USetupData.LayoutId); + if (!LayoutList) { /* FIXME: Handle error! */ return; @@ -478,14 +484,17 @@ UpdateKBLayout(VOID) /* Search for default layout (if provided) */ if (newLayout != 0) { - for (ListEntry = GetFirstListEntry(USetupData.LayoutList); ListEntry; + PGENERIC_LIST_ENTRY ListEntry; + KLID LayoutId; + + for (ListEntry = GetFirstListEntry(LayoutList); ListEntry; ListEntry = GetNextListEntry(ListEntry)) { - PCWSTR pszLayoutId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - KLID LayoutId = (KLID)(pszLayoutId ? wcstoul(pszLayoutId, NULL, 16) : 0); + LayoutId = (KLID)(((PGENENTRY)GetListEntryData(ListEntry))->Id.Ul); if (newLayout == LayoutId) { - SetCurrentListEntry(USetupData.LayoutList, ListEntry); + DPRINT("Found 0x%08lx in LayoutList\n", newLayout); + SetCurrentListEntry(LayoutList, ListEntry); break; } } @@ -543,16 +552,9 @@ GetNTOSInstallationName( * QuitPage * * SIDEEFFECTS - * Init Sdi - * Init USetupData.SourcePath - * Init USetupData.SourceRootPath - * Init USetupData.SourceRootDir - * Init USetupData.SetupInf - * Init USetupData.RequiredPartitionDiskSpace + * Init PnpMgr + * Init USetupData * Init IsUnattendedSetup - * If unattended, init *List and sets the Codepage - * If unattended, init SelectedLanguageId - * If unattended, init USetupData.LanguageId * * RETURNS * Number of the next page. @@ -561,8 +563,6 @@ static PAGE_NUMBER SetupStartPage(PINPUT_RECORD Ir) { ULONG Error; - PGENERIC_LIST_ENTRY ListEntry; - PCWSTR LocaleId; MUIDisplayPage(SETUP_INIT_PAGE); @@ -582,57 +582,9 @@ SetupStartPage(PINPUT_RECORD Ir) if (WaitNoPendingInstallEvents(NULL) != STATUS_WAIT_0) DPRINT1("WaitNoPendingInstallEvents() failed to wait!\n"); + /* Retrieve any supplemental options from the unattend file */ CheckUnattendedSetup(&USetupData); - if (IsUnattendedSetup) - { - // TODO: Read options from inf - /* Load the hardware, language and keyboard layout lists */ - - USetupData.ComputerList = CreateComputerTypeList(USetupData.SetupInf); - USetupData.DisplayList = CreateDisplayDriverList(USetupData.SetupInf); - USetupData.KeyboardList = CreateKeyboardDriverList(USetupData.SetupInf); - - USetupData.LanguageList = CreateLanguageList(USetupData.SetupInf, DefaultLanguage); - - /* new part */ - SelectedLanguageId = DefaultLanguage; - wcscpy(DefaultLanguage, USetupData.LocaleID); - USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF); - - USetupData.LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, SelectedLanguageId, DefaultKBLayout); - - /* first we hack LanguageList */ - for (ListEntry = GetFirstListEntry(USetupData.LanguageList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!_wcsicmp(USetupData.LocaleID, LocaleId)) - { - DPRINT("found %S in LanguageList\n", LocaleId); - SetCurrentListEntry(USetupData.LanguageList, ListEntry); - break; - } - } - - /* now LayoutList */ - for (ListEntry = GetFirstListEntry(USetupData.LayoutList); ListEntry; - ListEntry = GetNextListEntry(ListEntry)) - { - LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id; - if (!_wcsicmp(USetupData.LocaleID, LocaleId)) - { - DPRINT("found %S in LayoutList\n", LocaleId); - SetCurrentListEntry(USetupData.LayoutList, ListEntry); - break; - } - } - - SetConsoleCodePage(); - - return INSTALL_INTRO_PAGE; - } - return LANGUAGE_PAGE; } @@ -642,10 +594,6 @@ SetupStartPage(PINPUT_RECORD Ir) * * Next pages: WelcomePage, QuitPage * - * SIDEEFFECTS - * Init SelectedLanguageId - * Init USetupData.LanguageId - * * RETURNS * Number of the next page. */ @@ -653,46 +601,49 @@ static PAGE_NUMBER LanguagePage(PINPUT_RECORD Ir) { GENERIC_LIST_UI ListUi; - PCWSTR NewLanguageId; BOOL RefreshPage = FALSE; - /* Initialize the computer settings list */ - if (USetupData.LanguageList == NULL) + /* Initialize the language settings list */ + LANGID NewLanguageId = USetupData.LocaleID; + if (!LanguageList) { - USetupData.LanguageList = CreateLanguageList(USetupData.SetupInf, DefaultLanguage); - if (USetupData.LanguageList == NULL) + LanguageList = CreateLanguageList(USetupData.SetupInf, &NewLanguageId); + if (!LanguageList) { - PopupError("Setup failed to initialize available translations", NULL, NULL, POPUP_WAIT_NONE); - return WELCOME_PAGE; + PopupError("Setup failed to initialize available translations", NULL, NULL, POPUP_WAIT_NONE); + return WELCOME_PAGE; } } - SelectedLanguageId = DefaultLanguage; - USetupData.LanguageId = 0; + USetupData.LocaleID = (LCID)NewLanguageId; +/******/DefaultLanguage = LANGIDFROMLCID(USetupData.LocaleID);/*****/ // FIXME: Deprecate DefaultLanguage + SelectedLanguageId = LANGIDFROMLCID(USetupData.LocaleID); // FIXME: Should we keep SelectedLanguageId ? /* Load the font */ SetConsoleCodePage(); UpdateKBLayout(); + + if (IsUnattendedSetup) + return INSTALL_INTRO_PAGE; + + /* * If there is no language or just a single one in the list, * skip the language selection process altogether. */ - if (GetNumberOfListEntries(USetupData.LanguageList) <= 1) - { - USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF); + if (GetNumberOfListEntries(LanguageList) <= 1) return WELCOME_PAGE; - } - InitGenericListUi(&ListUi, USetupData.LanguageList, GetSettingDescription); + MUIDisplayPage(LANGUAGE_PAGE); + + InitGenericListUi(&ListUi, LanguageList, GetSettingDescription); DrawGenericList(&ListUi, 2, 18, xScreen - 3, yScreen - 3); - ScrollToPositionGenericList(&ListUi, GetDefaultLanguageIndex()); - - MUIDisplayPage(LANGUAGE_PAGE); + // ScrollToPositionGenericList(&ListUi, GetDefaultLanguageIndex()); while (TRUE) { @@ -732,17 +683,15 @@ LanguagePage(PINPUT_RECORD Ir) } else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */ { - ASSERT(GetNumberOfListEntries(USetupData.LanguageList) >= 1); + ASSERT(GetNumberOfListEntries(LanguageList) >= 1); SelectedLanguageId = - ((PGENENTRY)GetListEntryData(GetCurrentListEntry(USetupData.LanguageList)))->Id; + (LCID)(((PGENENTRY)GetListEntryData(GetCurrentListEntry(LanguageList)))->Id.Ul); - USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF); + USetupData.LocaleID = SelectedLanguageId; - if (wcscmp(SelectedLanguageId, DefaultLanguage)) - { + if (SelectedLanguageId != DefaultLanguage) UpdateKBLayout(); - } /* Load the font */ SetConsoleCodePage(); @@ -758,12 +707,12 @@ LanguagePage(PINPUT_RECORD Ir) if (RefreshPage) { - ASSERT(GetNumberOfListEntries(USetupData.LanguageList) >= 1); + ASSERT(GetNumberOfListEntries(LanguageList) >= 1); NewLanguageId = - ((PGENENTRY)GetListEntryData(GetCurrentListEntry(USetupData.LanguageList)))->Id; + (LCID)(((PGENENTRY)GetListEntryData(GetCurrentListEntry(LanguageList)))->Id.Ul); - if (wcscmp(SelectedLanguageId, NewLanguageId)) + if (SelectedLanguageId != NewLanguageId) { /* Clear the language page */ MUIClearPage(LANGUAGE_PAGE); @@ -773,14 +722,14 @@ LanguagePage(PINPUT_RECORD Ir) /* Load the font */ SetConsoleCodePage(); + /* Redraw language selection page in native language */ + MUIDisplayPage(LANGUAGE_PAGE); + /* Redraw the list */ DrawGenericList(&ListUi, 2, 18, xScreen - 3, yScreen - 3); - - /* Redraw language selection page in native language */ - MUIDisplayPage(LANGUAGE_PAGE); } RefreshPage = FALSE; @@ -1201,10 +1150,10 @@ OemDriverPage(PINPUT_RECORD Ir) * QuitPage * * SIDEEFFECTS - * Init USetupData.ComputerList - * Init USetupData.DisplayList - * Init USetupData.KeyboardList - * Init USetupData.LayoutList + * Init ComputerList + * Init DisplayList + * Init KeyboardList + * Init LayoutList * * RETURNS * Number of the next page. @@ -1212,65 +1161,78 @@ OemDriverPage(PINPUT_RECORD Ir) static PAGE_NUMBER DeviceSettingsPage(PINPUT_RECORD Ir) { + PGENERIC_LIST_ENTRY Entry; + static ULONG Line = 16; /* Initialize the computer settings list */ - if (USetupData.ComputerList == NULL) + if (!ComputerList) { - USetupData.ComputerList = CreateComputerTypeList(USetupData.SetupInf); - if (USetupData.ComputerList == NULL) + ComputerList = CreateComputerTypeList(USetupData.SetupInf); + if (!ComputerList) { MUIDisplayError(ERROR_LOAD_COMPUTER, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } } + Entry = GetCurrentListEntry(ComputerList); + ASSERT(Entry); + USetupData.ComputerType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; /* Initialize the display settings list */ - if (USetupData.DisplayList == NULL) + if (!DisplayList) { - USetupData.DisplayList = CreateDisplayDriverList(USetupData.SetupInf); - if (USetupData.DisplayList == NULL) + DisplayList = CreateDisplayDriverList(USetupData.SetupInf); + if (!DisplayList) { MUIDisplayError(ERROR_LOAD_DISPLAY, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } } + Entry = GetCurrentListEntry(DisplayList); + ASSERT(Entry); + USetupData.DisplayType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; /* Initialize the keyboard settings list */ - if (USetupData.KeyboardList == NULL) + if (!KeyboardList) { - USetupData.KeyboardList = CreateKeyboardDriverList(USetupData.SetupInf); - if (USetupData.KeyboardList == NULL) + KeyboardList = CreateKeyboardDriverList(USetupData.SetupInf); + if (!KeyboardList) { MUIDisplayError(ERROR_LOAD_KEYBOARD, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } } + Entry = GetCurrentListEntry(KeyboardList); + ASSERT(Entry); + USetupData.KeyboardDriver = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; /* Initialize the keyboard layout list */ - if (!USetupData.LayoutList) + if (!LayoutList) { - USetupData.LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, SelectedLanguageId, DefaultKBLayout); - if (!USetupData.LayoutList) + LayoutList = CreateKeyboardLayoutList(USetupData.SetupInf, + LANGIDFROMLCID(USetupData.LocaleID), + &USetupData.LayoutId); + if (!LayoutList) { /* FIXME: report error */ MUIDisplayError(ERROR_LOAD_KBLAYOUT, Ir, POPUP_WAIT_ENTER); return QUIT_PAGE; } } + Entry = GetCurrentListEntry(LayoutList); + ASSERT(Entry); + USetupData.LayoutId = (KLID)(((PGENENTRY)GetListEntryData(Entry))->Id.Ul); - if (RepairUpdateFlag) + if (RepairUpdateFlag || IsUnattendedSetup) return SELECT_PARTITION_PAGE; - // if (IsUnattendedSetup) - // return SELECT_PARTITION_PAGE; - MUIDisplayPage(DEVICE_SETTINGS_PAGE); - DrawGenericListCurrentItem(USetupData.ComputerList, GetSettingDescription, 25, 11); - DrawGenericListCurrentItem(USetupData.DisplayList , GetSettingDescription, 25, 12); - DrawGenericListCurrentItem(USetupData.KeyboardList, GetSettingDescription, 25, 13); - DrawGenericListCurrentItem(USetupData.LayoutList , GetSettingDescription, 25, 14); + DrawGenericListCurrentItem(ComputerList, GetSettingDescription, 25, 11); + DrawGenericListCurrentItem(DisplayList , GetSettingDescription, 25, 12); + DrawGenericListCurrentItem(KeyboardList, GetSettingDescription, 25, 13); + DrawGenericListCurrentItem(LayoutList , GetSettingDescription, 25, 14); CONSOLE_InvertTextXY(24, Line, 48, 1); @@ -1325,7 +1287,30 @@ DeviceSettingsPage(PINPUT_RECORD Ir) else if (Line == 14) return LAYOUT_SETTINGS_PAGE; else if (Line == 16) + { + /* Retrieve the computer settings */ + Entry = GetCurrentListEntry(ComputerList); + ASSERT(Entry); + USetupData.ComputerType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + + /* Retrieve the display settings */ + Entry = GetCurrentListEntry(DisplayList); + ASSERT(Entry); + USetupData.DisplayType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + + /* Retrieve the keyboard settings */ + Entry = GetCurrentListEntry(KeyboardList); + ASSERT(Entry); + USetupData.KeyboardDriver = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + + /* Retrieve the keyboard layout */ + Entry = GetCurrentListEntry(LayoutList); + ASSERT(Entry); + USetupData.LayoutId = (KLID)(((PGENENTRY)GetListEntryData(Entry))->Id.Ul); + + /* The user has accepted the settings; we continue installation */ return SELECT_PARTITION_PAGE; + } } } @@ -1412,7 +1397,7 @@ ComputerSettingsPage(PINPUT_RECORD Ir) GENERIC_LIST_UI ListUi; MUIDisplayPage(COMPUTER_SETTINGS_PAGE); - InitGenericListUi(&ListUi, USetupData.ComputerList, GetSettingDescription); + InitGenericListUi(&ListUi, ComputerList, GetSettingDescription); DrawGenericList(&ListUi, 2, 18, xScreen - 3, @@ -1438,7 +1423,7 @@ DisplaySettingsPage(PINPUT_RECORD Ir) GENERIC_LIST_UI ListUi; MUIDisplayPage(DISPLAY_SETTINGS_PAGE); - InitGenericListUi(&ListUi, USetupData.DisplayList, GetSettingDescription); + InitGenericListUi(&ListUi, DisplayList, GetSettingDescription); DrawGenericList(&ListUi, 2, 18, xScreen - 3, @@ -1464,7 +1449,7 @@ KeyboardSettingsPage(PINPUT_RECORD Ir) GENERIC_LIST_UI ListUi; MUIDisplayPage(KEYBOARD_SETTINGS_PAGE); - InitGenericListUi(&ListUi, USetupData.KeyboardList, GetSettingDescription); + InitGenericListUi(&ListUi, KeyboardList, GetSettingDescription); DrawGenericList(&ListUi, 2, 18, xScreen - 3, @@ -1490,7 +1475,7 @@ LayoutSettingsPage(PINPUT_RECORD Ir) GENERIC_LIST_UI ListUi; MUIDisplayPage(LAYOUT_SETTINGS_PAGE); - InitGenericListUi(&ListUi, USetupData.LayoutList, GetSettingDescription); + InitGenericListUi(&ListUi, LayoutList, GetSettingDescription); DrawGenericList(&ListUi, 2, 18, xScreen - 3, @@ -3416,11 +3401,60 @@ RegistryPage(PINPUT_RECORD Ir) MUIDisplayPage(REGISTRY_PAGE); +/******************/ +// +// TEMPTEMP : Sanity checks for lists consistency +// +{ + PGENERIC_LIST_ENTRY Entry; + + { + PCWSTR ComputerType; + Entry = GetCurrentListEntry(ComputerList); + ASSERT(Entry); + ComputerType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + ASSERT(ComputerType); + ASSERT(USetupData.ComputerType == ComputerType); + } + { + PCWSTR DisplayType; + Entry = GetCurrentListEntry(DisplayList); + ASSERT(Entry); + DisplayType = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + ASSERT(DisplayType); + ASSERT(USetupData.DisplayType == DisplayType); + } + { + PCWSTR KeyboardDriver; + Entry = GetCurrentListEntry(KeyboardList); + ASSERT(Entry); + KeyboardDriver = ((PGENENTRY)GetListEntryData(Entry))->Id.Str; + ASSERT(KeyboardDriver); + ASSERT(USetupData.KeyboardDriver == KeyboardDriver); + } + { + LCID LocaleId; + Entry = GetCurrentListEntry(LanguageList); + ASSERT(Entry); + LocaleId = (LCID)(((PGENENTRY)GetListEntryData(Entry))->Id.Ul); + ASSERT(LocaleId != 0); + ASSERT(USetupData.LocaleID == LocaleId); + } + { + KLID LayoutId; + Entry = GetCurrentListEntry(LayoutList); + ASSERT(Entry); + LayoutId = (KLID)(((PGENENTRY)GetListEntryData(Entry))->Id.Ul); + ASSERT(LayoutId != 0); + ASSERT(USetupData.LayoutId == LayoutId); + } +} +/******************/ + Error = UpdateRegistry(&USetupData, RepairUpdateFlag, PartitionList, InstallVolume->Info.DriveLetter, - SelectedLanguageId, RegistryStatus, &s_SubstSettings); if (Error != ERROR_SUCCESS) @@ -4075,6 +4109,8 @@ RunUSetup(VOID) return STATUS_APP_INIT_FAILURE; } +__debugbreak(); + /* Initialize Setup, phase 0 */ InitializeSetup(&USetupData, 0); USetupData.ErrorRoutine = USetupErrorRoutine; @@ -4234,6 +4270,33 @@ RunUSetup(VOID) /* Terminate the user-mode PnP manager */ TerminateUserModePnpManager(); + /* Destroy the settings lists */ + if (ComputerList) + { + DestroyGenericList(ComputerList, TRUE); + ComputerList = NULL; + } + if (DisplayList) + { + DestroyGenericList(DisplayList, TRUE); + DisplayList = NULL; + } + if (KeyboardList) + { + DestroyGenericList(KeyboardList, TRUE); + KeyboardList = NULL; + } + if (LanguageList) + { + DestroyGenericList(LanguageList, FALSE); + LanguageList = NULL; + } + if (LayoutList) + { + DestroyGenericList(LayoutList, TRUE); + LayoutList = NULL; + } + /* Setup has finished */ FinishSetup(&USetupData); diff --git a/base/setup/usetup/usetup.h b/base/setup/usetup/usetup.h index 91b94ac9699..33fd473ebfd 100644 --- a/base/setup/usetup/usetup.h +++ b/base/setup/usetup/usetup.h @@ -71,7 +71,13 @@ extern HANDLE ProcessHeap; extern BOOLEAN IsUnattendedSetup; -extern PCWSTR SelectedLanguageId; + +/* Settings lists *****/ +extern PGENERIC_LIST ComputerList; +extern PGENERIC_LIST DisplayList; +extern PGENERIC_LIST KeyboardList; +extern PGENERIC_LIST LanguageList; +extern PGENERIC_LIST LayoutList; typedef enum _PAGE_NUMBER { diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif index 32538b20475..5b1be04013d 100644 --- a/boot/bootdata/txtsetup.sif +++ b/boot/bootdata/txtsetup.sif @@ -223,8 +223,10 @@ OsLoadOptions = "/FASTDETECT /NOGUIBOOT /NODEBUG" AnsiCodepage = c_1252.nls OemCodepage = c_437.nls UnicodeCasetable = l_intl.nls -DefaultLayout = 00000409 -DefaultLanguage = 00000409 +;DefaultLayout = 00000409 +DefaultLayout = 0000041A +;DefaultLanguage = 00000409 +DefaultLanguage = 0000040C [Computer.NTx86] pci_up = "Standard PC Uniprocessor"