reactos/base/setup/usetup/mui.c

541 lines
12 KiB
C
Raw Normal View History

/*
* ReactOS kernel
* Copyright (C) 2008 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS text-mode setup
* FILE: base/setup/usetup/mui.c
* PURPOSE: Text-mode setup
* PROGRAMMER:
*/
#include "usetup.h"
#include "muilanguages.h"
#define NDEBUG
#include <debug.h>
static
ULONG
FindLanguageIndex(VOID)
{
ULONG lngIndex = 0;
if (SelectedLanguageId == NULL)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
/* Default to en-US */
return 0; // FIXME!!
// SelectedLanguageId = L"00000409";
}
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
while (ResourceList[lngIndex].MuiPages != NULL)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
{
return lngIndex;
}
lngIndex++;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
}
return 0;
}
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
#if 0
BOOLEAN
IsLanguageAvailable(
PWCHAR LanguageId)
{
ULONG lngIndex = 0;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
while (ResourceList[lngIndex].MuiPages != NULL)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
if (_wcsicmp(ResourceList[lngIndex].LanguageID, LanguageId) == 0)
return TRUE;
lngIndex++;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
}
return FALSE;
}
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
#endif
static
const MUI_ENTRY *
FindMUIEntriesOfPage(
IN ULONG PageNumber)
{
ULONG muiIndex = 0;
ULONG lngIndex;
const MUI_PAGE * Pages = NULL;
lngIndex = max(FindLanguageIndex(), 0);
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
Pages = ResourceList[lngIndex].MuiPages;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
while (Pages[muiIndex].MuiEntry != NULL)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
if (Pages[muiIndex].Number == PageNumber)
return Pages[muiIndex].MuiEntry;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
muiIndex++;
}
return NULL;
}
static
const MUI_ERROR *
FindMUIErrorEntries(VOID)
{
ULONG lngIndex = max(FindLanguageIndex(), 0);
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
return ResourceList[lngIndex].MuiErrors;
}
static
const MUI_STRING *
FindMUIStringEntries(VOID)
{
ULONG lngIndex = max(FindLanguageIndex(), 0);
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
return ResourceList[lngIndex].MuiStrings;
}
VOID
MUIClearPage(
IN ULONG page)
{
const MUI_ENTRY * entry;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
ULONG index;
entry = FindMUIEntriesOfPage(page);
if (!entry)
{
PopupError("Error: Failed to find translated page",
NULL,
NULL,
POPUP_WAIT_NONE);
return;
}
index = 0;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
while (entry[index].Buffer != NULL)
{
CONSOLE_ClearStyledText(entry[index].X,
entry[index].Y,
entry[index].Flags,
(USHORT)strlen(entry[index].Buffer));
index++;
}
}
VOID
MUIDisplayPage(
IN ULONG page)
{
const MUI_ENTRY * entry;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
ULONG index;
entry = FindMUIEntriesOfPage(page);
if (!entry)
{
PopupError("Error: Failed to find translated page",
NULL,
NULL,
POPUP_WAIT_NONE);
return;
}
index = 0;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
while (entry[index].Buffer != NULL)
{
CONSOLE_SetStyledText(entry[index].X,
entry[index].Y,
entry[index].Flags,
entry[index].Buffer);
index++;
}
}
VOID
MUIDisplayErrorV(
IN ULONG ErrorNum,
OUT PINPUT_RECORD Ir,
IN ULONG WaitEvent,
IN va_list args)
{
const MUI_ERROR* entry;
CHAR Buffer[2048];
if (ErrorNum >= ERROR_LAST_ERROR_CODE)
{
PopupError("Invalid error number provided",
"Press ENTER to continue",
Ir,
POPUP_WAIT_ENTER);
return;
}
entry = FindMUIErrorEntries();
if (!entry)
{
PopupError("Error: Failed to find translated error message",
NULL,
NULL,
POPUP_WAIT_NONE);
return;
}
vsprintf(Buffer, entry[ErrorNum].ErrorText, args);
PopupError(Buffer,
entry[ErrorNum].ErrorStatus,
Ir,
WaitEvent);
}
VOID
__cdecl
MUIDisplayError(
IN ULONG ErrorNum,
OUT PINPUT_RECORD Ir,
IN ULONG WaitEvent,
...)
{
va_list arg_ptr;
va_start(arg_ptr, WaitEvent);
MUIDisplayErrorV(ErrorNum, Ir, WaitEvent, arg_ptr);
va_end(arg_ptr);
}
PCSTR
MUIGetString(
ULONG Number)
{
ULONG i;
const MUI_STRING * entry;
CHAR szErr[128];
entry = FindMUIStringEntries();
if (entry)
{
for (i = 0; entry[i].Number != 0; i++)
{
if (entry[i].Number == Number)
{
return entry[i].String;
}
}
}
sprintf(szErr, "Error: failed find string id %lu for language index %lu\n", Number, FindLanguageIndex());
PopupError(szErr,
NULL,
NULL,
POPUP_WAIT_NONE);
return "<nostring>";
}
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
/**
* @MUIGetEntry
*
* Retrieves a MUI entry of a page, given the page number and the text ID.
*
* @param[in] Page
* The MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
*
* @param[in] TextID
* The text identification number (ID), as a unsigned integer. The parameter is used to identify
* its MUI properties like the coordinates, text style flag and its buffer content.
*
* @return
* Returns a constant MUI entry.
*
*/
const MUI_ENTRY *
MUIGetEntry(
IN ULONG Page,
IN INT TextID)
{
const MUI_ENTRY * entry;
ULONG index;
/* Retrieve the entries of a MUI page */
entry = FindMUIEntriesOfPage(Page);
if (!entry)
{
DPRINT("MUIGetEntryData(): Failed to get the translated entry page!\n");
return NULL;
}
/* Loop over the ID entries and check if it matches with one of them */
for (index = 0; entry[index].Buffer != NULL; index++)
{
if (entry[index].TextID == TextID)
{
/* They match so return the MUI entry */
return &entry[index];
}
}
/* Page number or ID are incorrect so in this case bail out */
DPRINT("Couldn't get the MUI entry field from the page!\n");
return NULL;
}
/**
* @MUIClearText
*
* Clears a portion of text from the console output.
*
* @param[in] Page
* The MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
*
* @param[in] TextID
* The text identification number (ID), as an integer. The parameter is used to identify
* its MUI properties like the coordinates, text style flag and its buffer content.
*
* @return
* Nothing.
*
*/
VOID
MUIClearText(
IN ULONG Page,
IN INT TextID)
{
const MUI_ENTRY * entry;
ULONG Index = 0;
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
/* Get the MUI entry */
entry = MUIGetEntry(Page, TextID);
if (!entry)
return;
/* Ensure that the text string given by the text ID and page is not NULL */
while (entry[Index].Buffer != NULL)
{
/* If text ID is not correct, skip the entry */
if (entry[Index].TextID != TextID)
{
Index++;
continue;
}
/* Remove the text by using CONSOLE_ClearTextXY() */
CONSOLE_ClearTextXY(
entry[Index].X,
entry[Index].Y,
(USHORT)strlen(entry[Index].Buffer));
/* Increment the index and loop over next entires with the same ID */
Index++;
}
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
}
/**
* @MUIClearStyledText
*
* Clears a portion of text from the console output, given the actual state style flag of the text.
*
* @param[in] Page
* The MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
*
* @param[in] TextID
* The text identification number (ID), as an integer. The parameter is used to identify
* its MUI properties like the coordinates, text style flag and its buffer content.
*
* @param[in] Flags
* The text style flag, as an integer. The flag determines the style of the text, such
* as being highlighted, underlined, high padding and so on.
*
* @return
* Nothing.
*
*/
VOID
MUIClearStyledText(
IN ULONG Page,
IN INT TextID,
IN INT Flags)
{
const MUI_ENTRY * entry;
ULONG Index = 0;
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
/* Get the MUI entry */
entry = MUIGetEntry(Page, TextID);
if (!entry)
return;
/* Ensure that the text string given by the text ID and page is not NULL */
while (entry[Index].Buffer != NULL)
{
/* If text ID is not correct, skip the entry */
if (entry[Index].TextID != TextID)
{
Index++;
continue;
}
/* Now, begin removing the text by calling CONSOLE_ClearStyledText() */
CONSOLE_ClearStyledText(
entry[Index].X,
entry[Index].Y,
Flags,
(USHORT)strlen(entry[Index].Buffer));
/* Increment the index and loop over next entires with the same ID */
Index++;
}
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
}
/**
* @MUISetText
*
* Prints a text to the console output.
*
* @param[in] Page
* The MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
*
* @param[in] TextID
* The text identification number (ID), as an integer. The parameter is used to identify
* its MUI properties like the coordinates, text style flag and its buffer content.
*
* @return
* Nothing.
*
*/
VOID
MUISetText(
IN ULONG Page,
IN INT TextID)
{
const MUI_ENTRY * entry;
ULONG Index = 0;
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
/* Get the MUI entry */
entry = MUIGetEntry(Page, TextID);
if (!entry)
return;
/* Ensure that the text string given by the text ID and page is not NULL */
while (entry[Index].Buffer != NULL)
{
/* If text ID is not correct, skip the entry */
if (entry[Index].TextID != TextID)
{
Index++;
continue;
}
/* Print the text to the console output by calling CONSOLE_SetTextXY() */
CONSOLE_SetTextXY(entry[Index].X, entry[Index].Y, entry[Index].Buffer);
/* Increment the index and loop over next entires with the same ID */
Index++;
}
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
}
/**
* @MUISetStyledText
*
* Prints a text to the console output, with a style for it.
*
* @param[in] Page
* The MUI (Multilingual User Interface) entry page number, as a unsigned long integer.
*
* @param[in] TextID
* The text identification number (ID), as an integer. The parameter is used to identify
* its MUI properties like the coordinates, text style flag and its buffer content.
*
* @param[in] Flags
* The text style flag, as an integer. The flag determines the style of the text, such
* as being highlighted, underlined, high padding and so on.
*
* @return
* Nothing.
*
*/
VOID
MUISetStyledText(
IN ULONG Page,
IN INT TextID,
IN INT Flags)
{
const MUI_ENTRY * entry;
ULONG Index = 0;
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
/* Get the MUI entry */
entry = MUIGetEntry(Page, TextID);
if (!entry)
return;
/* Ensure that the text string given by the text ID and page is not NULL */
while (entry[Index].Buffer != NULL)
{
/* If text ID is not correct, skip the entry */
if (entry[Index].TextID != TextID)
{
Index++;
continue;
}
/* Print the text to the console output by calling CONSOLE_SetStyledText() */
CONSOLE_SetStyledText(entry[Index].X, entry[Index].Y, Flags, entry[Index].Buffer);
/* Increment the index and loop over next entires with the same ID */
Index++;
}
[USETUP] Implement resource ID text based strings for MUI (#2193) CORE-12683 Supersedes PR #612. * [USETUP] Implement the internal MUI routines for text manipulation based on its ID and implement text resource based IDs USETUP (the 1st stage text mode setup module) bases upon MUI (Multilingual User Interface) sub-component of USETUP which is responsible for the ability into translating the MUI pages (each page having corresponding properties like X, Y coordinates, text flags and text string buffer) in various languages. The only problem, as of now, is that whenever you want to modify a certain property of a page, such as removing a text from the said page in the screen, you've got to rely on using CONSOLE_* specific functions and calling with hardcoded parameters, namely the coordinates. This can become a problem as not every localized (translated) MUI page has the same properties for each language and this could lead to various issues. Therefore, assigning each entry with an ID you can remove a text by only giving its ID (and the entry page number) without having the need to specify the coordinates as the internal MUI routine, MUIGetEntry(), automatically retrieves the entry with respective data fields. The following commit implements: - MUIGetEntry() - MUIClearText() - MUIClearStyledText() - MUISetText() - MUISetStyledText() - Now the X and Y coordinate members of MUI_ENTRY are of SHORT integer type, for the sake of the general code as most of the coordination values, even the COORD structure itself, has the coordination points as SHORTs and not BYTEs. The following MUI functions will be used to manipulate text based resources depending on their ID from the corresponding MUI entry. * [USETUP] Make CONSOLE_ClearTextXY function public so that we can use across other files. * [USETUP] Implement the IDs for each text MUI entry in locale files. This mechanism follows the same principle of resource IDs in Win32 applications. Static text is merely a resource that doesn't get changed programmatically for whole of its lifetime whereas dynamic resources can change during the lifetime of the program depending on the algorithm (for example, hide that piece of text and set another one, etc.). * [USETUP] Remove the "Press ENTER to continue" message prompt when the partition formatting begins.
2020-01-19 16:58:13 +00:00
}
VOID
SetConsoleCodePage(VOID)
{
UINT wCodePage;
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
#if 0
ULONG lngIndex = 0;
while (ResourceList[lngIndex].MuiPages != NULL)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
if (_wcsicmp(ResourceList[lngIndex].LanguageID, SelectedLanguageId) == 0)
{
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
wCodePage = (UINT) wcstoul(ResourceList[lngIndex].OEMCPage, NULL, 10);
SetConsoleOutputCP(wCodePage);
return;
}
lngIndex++;
}
[SETUPLIB][USETUP][INPUT.CPL] MUI integration with setuplib. [SETUPLIB] Copy the mui* files from usetup into the setuplib for later usage, and add mui.c to build. svn path=/branches/setup_improvements/; revision=75711 [SETUPLIB][USETUP] Start massaging the MUI files and split up what concerns only the usetup "resources", and what concerns general language parameters (in the setuplib). It may be interesting to retrieve the language parameters from INF file (e.g. intl.inf) (suggested by Giannis). svn path=/branches/setup_improvements/; revision=75715 [SETUPLIB] Add the necessary headers to mui.c to be able to compile. [USETUP] Comment out the languages that don't have any resources. svn path=/branches/setup_improvements/; revision=75716 [SETUPLIB][USETUP] Adjust MUI and settings code. - Re-enable settings code concerning language, keyboards & layout in the setuplib, and remove the old code in usetup. - Remove useless code in setuplib's mui.c. - Rename usetup's MUI "LanguageList" into "ResourceList" so as to avoid colliding with the "LanguageList" of setuplib. - Add the magic CMakeLists line "add_definitions(${I18N_DEFS})" that I forgot previously, that caused the "LanguageList" of setuplib to be empty! The code compiles and works during my tests. svn path=/branches/setup_improvements/; revision=75717 [SETUPLIB] Change some string pointer types & function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. svn path=/branches/setup_improvements/; revision=75719 [SETUPLIB] Change some function prototypes so that the usetup-specific "SelectedLanguageId" variable is not used in the library. Also, make AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE private again. svn path=/branches/setup_improvements/; revision=75720 svn path=/branches/setup_improvements/; revision=75724 [USETUP] Code adaptations. - Transform some do{}while() loops into while(){} ones, since the lists on which we work may only contain one single {NULL} element. - Modify MUIGetOEMCodePage() call after r75719. - Use PCWSTR where needed. svn path=/branches/setup_improvements/; revision=75722 [USETUP] Adjust some MUI & settings calls, following the commits r75719, r75720 and r75721. svn path=/branches/setup_improvements/; revision=75723 [INPUT.CPL] Adjust inclusion of "muifonts.h" (commit 3dbd44f) due to changes introduced in r75711 and r75715.
2017-08-30 11:28:52 +00:00
#else
wCodePage = (UINT)wcstoul(MUIGetOEMCodePage(SelectedLanguageId), NULL, 10);
SetConsoleOutputCP(wCodePage);
#endif
}
/* EOF */