Author: cfinck
Date: Tue Jan 8 00:34:56 2008
New Revision: 31655
URL:
http://svn.reactos.org/svn/reactos?rev=31655&view=rev
Log:
Win32k:
- Read from HKCU\Keyboard Layout\Preload for getting the keyboard layout ID to use instead
of using the default locale.
This finally makes it possible to set the keyboard layout and system locale
independently.
- Change ReadRegistryValue from KEY_ALL_ACCESS to KEY_READ, we don't need more
rights.
usetup:
- Rename "ProcessKeyboardLayoutRegistry" to "ProcessLocaleRegistry" as
it doesn't set anything related to keyboard layouts.
- Add a new function "ProcessKeyboardLayoutRegistry", which sets the keyboard
layout ID in the correct registry key.
- Add ERROR_UPDATE_LOCALE_SETTINGS
- Fix the indentation of some parts of the language headers and update the german one.
Known issues:
- Before input.dll is finished, we can only set the keyboard layout in usetup or by
manually editing the registry.
- 1st stage and 2nd stage setup always use US English keyboard layout for now.
See issue #2635 for more details.
Modified:
trunk/reactos/base/setup/usetup/errorcode.h
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/lang/de-DE.h
trunk/reactos/base/setup/usetup/lang/el-GR.h
trunk/reactos/base/setup/usetup/lang/en-US.h
trunk/reactos/base/setup/usetup/lang/es-ES.h
trunk/reactos/base/setup/usetup/lang/fr-FR.h
trunk/reactos/base/setup/usetup/lang/it-IT.h
trunk/reactos/base/setup/usetup/lang/pl-PL.h
trunk/reactos/base/setup/usetup/lang/ru-RU.h
trunk/reactos/base/setup/usetup/lang/sv-SE.h
trunk/reactos/base/setup/usetup/lang/uk-UA.h
trunk/reactos/base/setup/usetup/settings.c
trunk/reactos/base/setup/usetup/settings.h
trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c
Modified: trunk/reactos/base/setup/usetup/errorcode.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/errorcod…
==============================================================================
--- trunk/reactos/base/setup/usetup/errorcode.h (original)
+++ trunk/reactos/base/setup/usetup/errorcode.h Tue Jan 8 00:34:56 2008
@@ -63,6 +63,7 @@
ERROR_FIND_SETUPDATA,
ERROR_WRITE_PTABLE,
ERROR_ADDING_CODEPAGE,
+ ERROR_UPDATE_LOCALESETTINGS,
ERROR_LAST_ERROR_CODE
}ERROR_NUMBER;
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c Tue Jan 8 00:34:56 2008
@@ -3139,9 +3139,17 @@
return QUIT_PAGE;
}
+ /* Set the locale */
+ CONSOLE_SetStatusText(" Updating locale settings...");
+ if (!ProcessLocaleRegistry(LanguageList))
+ {
+ MUIDisplayError(ERROR_UPDATE_LOCALESETTINGS, Ir, POPUP_WAIT_ENTER);
+ return QUIT_PAGE;
+ }
+
/* Update keyboard layout settings */
CONSOLE_SetStatusText(" Updating keyboard layout settings...");
- if (!ProcessKeyboardLayoutRegistry(LanguageList))
+ if (!ProcessKeyboardLayoutRegistry(LayoutList))
{
MUIDisplayError(ERROR_UPDATE_KBSETTINGS, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
Modified: trunk/reactos/base/setup/usetup/lang/de-DE.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/de-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/de-DE.h (original)
+++ trunk/reactos/base/setup/usetup/lang/de-DE.h Tue Jan 8 00:34:56 2008
@@ -1276,12 +1276,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS ist nicht vollstaendig auf Ihrem System installiert.\n"
- "Wenn Sie das Setup jetzt beenden, muessen Sie das\n"
- "Setup erneut starten, um ROS zu installieren.\n"
- "\n"
- " \x07 Druecken Sie ENTER um das Setup Fortzusetzen.\n"
- " \x07 Druecken Sie F3 um das Setup zu beenden.",
- "F3 = Beenden ENTER = Fortsetzen"
+ "Wenn Sie das Setup jetzt beenden, muessen Sie das\n"
+ "Setup erneut starten, um ROS zu installieren.\n"
+ "\n"
+ " \x07 Druecken Sie ENTER um das Setup Fortzusetzen.\n"
+ " \x07 Druecken Sie F3 um das Setup zu beenden.",
+ "F3 = Beenden ENTER = Fortsetzen"
},
{
//ERROR_NO_HDD
@@ -1340,21 +1340,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup hat mindestens eine Festplatte mit einer inkompatiblen
Partitionstabelle\n"
- "welche nicht richtig verwendet werden koennen!\n"
- "\n"
- "Partitionen zu erstellen/loeschen kann die Partitionstabelle
zerstoeren.\n"
- "\n"
- " \x07 Druecken Sie F3, um das Setup zu beenden."
- " \x07 Druecken Sie ENTER, um das Setup Fortzusetzen.",
- "F3 = Beenden ENTER = Fortsetzen"
+ "Setup hat mindestens eine Festplatte mit einer inkompatiblen
Partitionstabelle\n"
+ "welche nicht richtig verwendet werden koennen!\n"
+ "\n"
+ "Partitionen zu erstellen/loeschen kann die Partitionstabelle
zerstoeren.\n"
+ "\n"
+ " \x07 Druecken Sie F3, um das Setup zu beenden."
+ " \x07 Druecken Sie ENTER, um das Setup Fortzusetzen.",
+ "F3 = Beenden ENTER = Fortsetzen"
},
{
//ERROR_NEW_PARTITION,
"Sie koennen keine neue Partition in einer bereits\n"
- "vohandenen Partition erstellen!\n"
- "\n"
- " * * Eine beliebige Taste zum Fortsetzen druecken.",
+ "vohandenen Partition erstellen!\n"
+ "\n"
+ " * * Eine beliebige Taste zum Fortsetzen druecken.",
NULL
},
{
@@ -1449,8 +1449,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup konnte die 'SetupData' Sektion in\n"
- "TXTSETUP.SIF nicht finden.\n",
- "ENTER = Computer neustarten"
+ "TXTSETUP.SIF nicht finden.\n",
+ "ENTER = Computer neustarten"
},
{
//ERROR_WRITE_PTABLE,
@@ -1459,8 +1459,13 @@
},
{
//ERROR_ADDING_CODEPAGE,
- "Setup failed to add codepage to registry.\n"
- "ENTER = Reboot computer"
+ "Setup konnte den CodePage-Eintrag nicht hinzufuegen.\n"
+ "ENTER = Computer neustarten"
+ },
+ {
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup konnte die Systemsprache nicht einstellen.\n"
+ "ENTER = Computer neustarten"
},
{
NULL,
Modified: trunk/reactos/base/setup/usetup/lang/el-GR.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/el-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/el-GR.h (original)
+++ trunk/reactos/base/setup/usetup/lang/el-GR.h Tue Jan 8 00:34:56 2008
@@ -1270,12 +1270,12 @@
{
//ERROR_NOT_INSTALLED
"Ôï ReactOS äåí åãêáôáóôÜèçêå ðëÞñùò óôïí\n"
- "õðïëïãéóôÞ óáò. Áí áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç ôþñá, èá ðñÝðåé
íá\n"
- "îáíáôñÝîåôå ôçí ÅãêáôÜóôáóç ãéá íá åãêáôáóôÞóåô ôï ReactOS.\n"
- "\n"
- " \x07 ÐáôÞóôå ENTER ãéá áí óõíå÷ßóåôå ôçí ÅãêáôÜóôáóç.\n"
- " \x07 ÐáôÞóôå F3 ãéá íá áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç.",
- "F3= Áðï÷þñçóç ENTER = ÓõíÝ÷åéá"
+ "õðïëïãéóôÞ óáò. Áí áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç ôþñá, èá ðñÝðåé
íá\n"
+ "îáíáôñÝîåôå ôçí ÅãêáôÜóôáóç ãéá íá åãêáôáóôÞóåô ôï ReactOS.\n"
+ "\n"
+ " \x07 ÐáôÞóôå ENTER ãéá áí óõíå÷ßóåôå ôçí ÅãêáôÜóôáóç.\n"
+ " \x07 ÐáôÞóôå F3 ãéá íá áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç.",
+ "F3= Áðï÷þñçóç ENTER = ÓõíÝ÷åéá"
},
{
//ERROR_NO_HDD
@@ -1335,20 +1335,20 @@
{
//ERROR_WARN_PARTITION,
"Ç ÅãêáôÜóôáóç âñÞêå üôé ôïõëÜ÷éóôïí Ýíáò óêëçñüò äßóêïò ðåñéÝ÷åé Ýíá ìç
óõìâáôü\n"
- "partition table ðïõ äå ìðïñåß íá åëåã÷èåß óùóôÜ!\n"
- "\n"
- "Ç äçìéïõñãßá Þ äéáãñáöÞ partitions ìðïñåß íá êáôáóôñÝøåé ôï partiton
table.\n"
- "\n"
- " \x07 ÐáôÞóôå F3 ãéá íá áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç."
- " \x07 ÐáôÞóôå ENTER ãéá íá óõíå÷ßóåôå.",
+ "partition table ðïõ äå ìðïñåß íá åëåã÷èåß óùóôÜ!\n"
+ "\n"
+ "Ç äçìéïõñãßá Þ äéáãñáöÞ partitions ìðïñåß íá êáôáóôñÝøåé ôï partiton
table.\n"
+ "\n"
+ " \x07 ÐáôÞóôå F3 ãéá íá áðï÷ùñÞóåôå áðü ôçí ÅãêáôÜóôáóç."
+ " \x07 ÐáôÞóôå ENTER ãéá íá óõíå÷ßóåôå.",
"F3= Áðï÷þñçóç ENTER = ÓõíÝ÷åéá"
},
{
//ERROR_NEW_PARTITION,
"Äå ìðïñåßôå íá äçìéïõñãÞóåôå Ýíá Partition ìÝóá óå\n"
- "Ýíá Üëëï õðÜñ÷ïí Partition!\n"
- "\n"
- " * ÐáôÞóôå ïðïéïäÞðïôå ðëÞêôñï ãéá íá óõíå÷ßóåôå.",
+ "Ýíá Üëëï õðÜñ÷ïí Partition!\n"
+ "\n"
+ " * ÐáôÞóôå ïðïéïäÞðïôå ðëÞêôñï ãéá íá óõíå÷ßóåôå.",
NULL
},
{
@@ -1443,8 +1443,8 @@
{
//ERROR_FIND_SETUPDATA,
"Ç ÅãêáôÜóôáóç áðÝôõ÷å íá âñåé ôïí ôïìÝá 'SetupData'\n"
- "óôï TXTSETUP.SIF.\n",
- "ENTER = Åðáíåêêßíçóç õðïëïãéóôÞ"
+ "óôï TXTSETUP.SIF.\n",
+ "ENTER = Åðáíåêêßíçóç õðïëïãéóôÞ"
},
{
//ERROR_WRITE_PTABLE,
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/en-US.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/en-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/en-US.h (original)
+++ trunk/reactos/base/setup/usetup/lang/en-US.h Tue Jan 8 00:34:56 2008
@@ -1270,12 +1270,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS is not completely installed on your\n"
- "computer. If you quit Setup now, you will need to\n"
- "run Setup again to install ReactOS.\n"
- "\n"
- " \x07 Press ENTER to continue Setup.\n"
- " \x07 Press F3 to quit Setup.",
- "F3 = Quit ENTER = Continue"
+ "computer. If you quit Setup now, you will need to\n"
+ "run Setup again to install ReactOS.\n"
+ "\n"
+ " \x07 Press ENTER to continue Setup.\n"
+ " \x07 Press F3 to quit Setup.",
+ "F3 = Quit ENTER = Continue"
},
{
//ERROR_NO_HDD
@@ -1335,20 +1335,20 @@
{
//ERROR_WARN_PARTITION,
"Setup found that at least one harddisk contains an incompatible\n"
- "partition table that can not be handled properly!\n"
- "\n"
- "Creating or deleting partitions can destroy the partition table.\n"
- "\n"
- " \x07 Press F3 to quit Setup."
- " \x07 Press ENTER to continue.",
+ "partition table that can not be handled properly!\n"
+ "\n"
+ "Creating or deleting partitions can destroy the partition table.\n"
+ "\n"
+ " \x07 Press F3 to quit Setup."
+ " \x07 Press ENTER to continue.",
"F3= Quit ENTER = Continue"
},
{
//ERROR_NEW_PARTITION,
"You can not create a new Partition inside\n"
- "of an already existing Partition!\n"
- "\n"
- " * Press any key to continue.",
+ "of an already existing Partition!\n"
+ "\n"
+ " * Press any key to continue.",
NULL
},
{
@@ -1443,8 +1443,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup failed to find the 'SetupData' section\n"
- "in TXTSETUP.SIF.\n",
- "ENTER = Reboot computer"
+ "in TXTSETUP.SIF.\n",
+ "ENTER = Reboot computer"
},
{
//ERROR_WRITE_PTABLE,
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/es-ES.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/es-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/es-ES.h (original)
+++ trunk/reactos/base/setup/usetup/lang/es-ES.h Tue Jan 8 00:34:56 2008
@@ -1346,9 +1346,9 @@
{
//ERROR_NEW_PARTITION,
"You can not create a new Partition inside\n"
- "of an already existing Partition!\n"
- "\n"
- " * Press any key to continue.",
+ "of an already existing Partition!\n"
+ "\n"
+ " * Press any key to continue.",
NULL
},
{
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/fr-FR.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/fr-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/fr-FR.h (original)
+++ trunk/reactos/base/setup/usetup/lang/fr-FR.h Tue Jan 8 00:34:56 2008
@@ -1282,12 +1282,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS n'est pas completement installe sur votre\n"
- "ordinateur. Si vous quittez Setup maintenant, vous devrez\n"
- "lancer Setup de nouveau pour installer ReactOS.\n"
- "\n"
- " \x07 Appuyer sur ENTER pour continuer Setup.\n"
- " \x07 Appuyer sur F3 pour quitter Setup.",
- "F3= Quitter ENTER = Continuer"
+ "ordinateur. Si vous quittez Setup maintenant, vous devrez\n"
+ "lancer Setup de nouveau pour installer ReactOS.\n"
+ "\n"
+ " \x07 Appuyer sur ENTER pour continuer Setup.\n"
+ " \x07 Appuyer sur F3 pour quitter Setup.",
+ "F3= Quitter ENTER = Continuer"
},
{
//ERROR_NO_HDD
@@ -1346,21 +1346,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup a detecte qu'au moins un dique dur contient une table\n"
- "de partition incompatible qui ne peut etre prise en compte!\n"
- "\n"
- "Creer ou effacer des partitions peut detruire la table de partition.\n"
- "\n"
- " \x07 Appuyer sur F3 pour quitter Setup."
- " \x07 Appuyer sur ENTER pour continuer Setup.",
- "F3= Quitter ENTER = Continuer"
+ "Setup a detecte qu'au moins un dique dur contient une table\n"
+ "de partition incompatible qui ne peut etre prise en compte!\n"
+ "\n"
+ "Creer ou effacer des partitions peut detruire la table de
partition.\n"
+ "\n"
+ " \x07 Appuyer sur F3 pour quitter Setup."
+ " \x07 Appuyer sur ENTER pour continuer Setup.",
+ "F3= Quitter ENTER = Continuer"
},
{
//ERROR_NEW_PARTITION,
"Vous ne pouvez creer une nouvelle Partition à l'interieur\n"
- "d'une Partition deja existante!\n"
- "\n"
- " * Appuyez sur une touche pour continuer.",
+ "d'une Partition deja existante!\n"
+ "\n"
+ " * Appuyez sur une touche pour continuer.",
NULL
},
{
@@ -1455,8 +1455,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup n'a pu trouver la section 'SetupData'\n"
- "in TXTSETUP.SIF.\n",
- "ENTER = Redemarrer l'ordinateur"
+ "in TXTSETUP.SIF.\n",
+ "ENTER = Redemarrer l'ordinateur"
},
{
//ERROR_WRITE_PTABLE,
@@ -1469,6 +1469,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/it-IT.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/it-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/it-IT.h (original)
+++ trunk/reactos/base/setup/usetup/lang/it-IT.h Tue Jan 8 00:34:56 2008
@@ -4,7 +4,7 @@
static MUI_ENTRY itITLanguagePageEntries[] =
{
{
- 4,
+ 4,
3,
" Installazione di ReactOS " KERNEL_VERSION_STR " ",
TEXT_UNDERLINE
@@ -1276,12 +1276,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS non è installato completamente nel vostro\n"
- "computer. Se esce adesso, dovrà eseguire il Setup\n"
- "nuovamente per installare ReactOS.\n"
- "\n"
- " \x07 Premere INVIO per continuare il setup.\n"
- " \x07 Premere F3 per uscire.",
- "F3= Uscire INVIO = Continuare"
+ "computer. Se esce adesso, dovrà eseguire il Setup\n"
+ "nuovamente per installare ReactOS.\n"
+ "\n"
+ " \x07 Premere INVIO per continuare il setup.\n"
+ " \x07 Premere F3 per uscire.",
+ "F3= Uscire INVIO = Continuare"
},
{
//ERROR_NO_HDD
@@ -1340,21 +1340,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup ha trovato che al meno un disco fisso contiene una tabella
delle\n"
- "partizioni incompatibile che non può essere gestita correttamente!\n"
- "\n"
- "Il creare o cancellare partizioni può distruggere la tabella delle
partizioni.\n"
- "\n"
- " \x07 Premere F3 per uscire dal Setup."
- " \x07 Premere INVIO per continuare.",
- "F3= Uscire INVIO = Continuare"
+ "Setup ha trovato che al meno un disco fisso contiene una tabella
delle\n"
+ "partizioni incompatibile che non può essere gestita correttamente!\n"
+ "\n"
+ "Il creare o cancellare partizioni può distruggere la tabella delle
partizioni.\n"
+ "\n"
+ " \x07 Premere F3 per uscire dal Setup."
+ " \x07 Premere INVIO per continuare.",
+ "F3= Uscire INVIO = Continuare"
},
{
//ERROR_NEW_PARTITION,
"Non si può creare una nuova partizione all'interno\n"
- "di una partizione già esistente!\n"
- "\n"
- " * Premere un tasto qualsiasi per continuare.",
+ "di una partizione già esistente!\n"
+ "\n"
+ " * Premere un tasto qualsiasi per continuare.",
NULL
},
{
@@ -1449,8 +1449,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup non ha trovato la sezione 'SetupData'\n"
- "in TXTSETUP.SIF.\n",
- "INVIO = Riavviare il computer"
+ "in TXTSETUP.SIF.\n",
+ "INVIO = Riavviare il computer"
},
{
//ERROR_WRITE_PTABLE,
@@ -1463,6 +1463,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/pl-PL.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/pl-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/pl-PL.h (original)
+++ trunk/reactos/base/setup/usetup/lang/pl-PL.h Tue Jan 8 00:34:56 2008
@@ -1278,12 +1278,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS nie zosta³ w pe³ni zainstalowany na twoim\n"
- "komputerze. Jeli wyjdziesz teraz, trzeba bêdzie\n"
- "ponownie uruchomiæ instalator by zainstalowaæ ReactOS.\n"
- "\n"
- " \x07 Nacinij ENTER aby kontynuowaæ instalacjê.\n"
- " \x07 Nacinij F3 aby wyjæ z instalatora.",
- "F3= Quit ENTER = Continue"
+ "komputerze. Jeli wyjdziesz teraz, trzeba bêdzie\n"
+ "ponownie uruchomiæ instalator by zainstalowaæ ReactOS.\n"
+ "\n"
+ " \x07 Nacinij ENTER aby kontynuowaæ instalacjê.\n"
+ " \x07 Nacinij F3 aby wyjæ z instalatora.",
+ "F3= Quit ENTER = Continue"
},
{
//ERROR_NO_HDD
@@ -1342,21 +1342,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Instalator wykry³, ¿e co najmniej jeden dysk twardy zawiera
niekompatybiln¹ \n"
- "tablicê partycji, która nie bêdzie poprawnie obs³ugiwana!\n"
- "\n"
- "Tworzenie lub kasowanie partycji mo¿e zniszczyæ ca³¹ tablicê partycji.\n"
- "\n"
- " \x07 Nacinij F3 aby wyjæ z instalatora."
- " \x07 Nacinij ENTER aby kontynuowaæ.",
- "F3= Wyjcie ENTER = Kontynuacja"
+ "Instalator wykry³, ¿e co najmniej jeden dysk twardy zawiera niekompatybiln¹
\n"
+ "tablicê partycji, która nie bêdzie poprawnie obs³ugiwana!\n"
+ "\n"
+ "Tworzenie lub kasowanie partycji mo¿e zniszczyæ ca³¹ tablicê
partycji.\n"
+ "\n"
+ " \x07 Nacinij F3 aby wyjæ z instalatora."
+ " \x07 Nacinij ENTER aby kontynuowaæ.",
+ "F3= Wyjcie ENTER = Kontynuacja"
},
{
//ERROR_NEW_PARTITION,
"Nie mo¿esz stworzyæ nowej partycji w miejscu ju¿\n"
- "istniej¹cej!\n"
- "\n"
- " * Nacinij dowolny klawisz aby kontynuowaæ.",
+ "istniej¹cej!\n"
+ "\n"
+ " * Nacinij dowolny klawisz aby kontynuowaæ.",
NULL
},
{
@@ -1451,8 +1451,8 @@
{
//ERROR_FIND_SETUPDATA,
"Instalator nie by³ w stanie znaleæ sekcji 'SetupData'\n"
- "w pliku TXTSETUP.SIF.\n",
- "ENTER = Restart komputera"
+ "w pliku TXTSETUP.SIF.\n",
+ "ENTER = Restart komputera"
},
{
//ERROR_WRITE_PTABLE,
@@ -1465,6 +1465,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/ru-RU.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/ru-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/ru-RU.h (original)
+++ trunk/reactos/base/setup/usetup/lang/ru-RU.h Tue Jan 8 00:34:56 2008
@@ -1270,12 +1270,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS íå áûë ïîëíîñòüþ óñòàíîâëåí íà âàø\n"
- "êîìïüþòåð. Åñëè âû âûéäèòå èç óñòàíîâêè ñåé÷àñ,\n"
- "òî âàì íóæíî çàïóñòèòü ïðîãðàììó óñòàíîâêè ñíîâà,\n"
- "åñëè âû õîòèòå óñòàíîâèòü ReactOS\n"
- " \x07 Íàæìèòå ENTER äëÿ ïðîäîëæåíèÿ óñòàíîâêè.\n"
- " \x07 Íàæìèòå F3 âûõîäà èç óñòàíîâêè.",
- "F3 = Âûõîä ENTER = Ïðîäîëæèòü"
+ "êîìïüþòåð. Åñëè âû âûéäèòå èç óñòàíîâêè ñåé÷àñ,\n"
+ "òî âàì íóæíî çàïóñòèòü ïðîãðàììó óñòàíîâêè ñíîâà,\n"
+ "åñëè âû õîòèòå óñòàíîâèòü ReactOS\n"
+ " \x07 Íàæìèòå ENTER äëÿ ïðîäîëæåíèÿ óñòàíîâêè.\n"
+ " \x07 Íàæìèòå F3 âûõîäà èç óñòàíîâêè.",
+ "F3 = Âûõîä ENTER = Ïðîäîëæèòü"
},
{
//ERROR_NO_HDD
@@ -1334,21 +1334,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup found that at least one harddisk contains an incompatible\n"
- "partition table that can not be handled properly!\n"
- "\n"
- "Creating or deleting partitions can destroy the partiton table.\n"
- "\n"
- " \x07 Íàæìèòå F3 äëÿ âûõîäà èç óñòàíîâêè."
- " \x07 Íàæìèòå ENTER äëÿ ïðîäîëæåíèÿ.",
- "F3 = Âûõîä ENTER = Ïðîäîëæèòü"
+ "Setup found that at least one harddisk contains an incompatible\n"
+ "partition table that can not be handled properly!\n"
+ "\n"
+ "Creating or deleting partitions can destroy the partiton table.\n"
+ "\n"
+ " \x07 Íàæìèòå F3 äëÿ âûõîäà èç óñòàíîâêè."
+ " \x07 Íàæìèòå ENTER äëÿ ïðîäîëæåíèÿ.",
+ "F3 = Âûõîä ENTER = Ïðîäîëæèòü"
},
{
//ERROR_NEW_PARTITION,
"You can not create a new Partition inside\n"
- "of an already existing Partition!\n"
- "\n"
- " * Íàæìèòå ëþáóþ êëàâèøó äëÿ ïðîäîëæåíèÿ.",
+ "of an already existing Partition!\n"
+ "\n"
+ " * Íàæìèòå ëþáóþ êëàâèøó äëÿ ïðîäîëæåíèÿ.",
NULL
},
{
@@ -1443,8 +1443,8 @@
{
//ERROR_FIND_SETUPDATA,
"Íå óäàëîñü íàéòè ñåêöèþ 'SetupData'\n"
- "â ôàéëå TXTSETUP.SIF.\n",
- "ENTER = Ïåðåçàãðóçêà"
+ "â ôàéëå TXTSETUP.SIF.\n",
+ "ENTER = Ïåðåçàãðóçêà"
},
{
//ERROR_WRITE_PTABLE,
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/sv-SE.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/sv-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/sv-SE.h (original)
+++ trunk/reactos/base/setup/usetup/lang/sv-SE.h Tue Jan 8 00:34:56 2008
@@ -1270,12 +1270,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS is not completely installed on your\n"
- "computer. If you quit Setup now, you will need to\n"
- "run Setup again to install ReactOS.\n"
- "\n"
- " \x07 Press ENTER to continue Setup.\n"
- " \x07 Press F3 to quit Setup.",
- "F3= Quit ENTER = Continue"
+ "computer. If you quit Setup now, you will need to\n"
+ "run Setup again to install ReactOS.\n"
+ "\n"
+ " \x07 Press ENTER to continue Setup.\n"
+ " \x07 Press F3 to quit Setup.",
+ "F3= Quit ENTER = Continue"
},
{
//ERROR_NO_HDD
@@ -1334,21 +1334,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup found that at least one harddisk contains an incompatible\n"
- "partition table that can not be handled properly!\n"
- "\n"
- "Creating or deleting partitions can destroy the partiton table.\n"
- "\n"
- " \x07 Press F3 to quit Setup."
- " \x07 Press ENTER to continue.",
- "F3= Quit ENTER = Continue"
+ "Setup found that at least one harddisk contains an incompatible\n"
+ "partition table that can not be handled properly!\n"
+ "\n"
+ "Creating or deleting partitions can destroy the partiton table.\n"
+ "\n"
+ " \x07 Press F3 to quit Setup."
+ " \x07 Press ENTER to continue.",
+ "F3= Quit ENTER = Continue"
},
{
//ERROR_NEW_PARTITION,
"You can not create a new Partition inside\n"
- "of an already existing Partition!\n"
- "\n"
- " * Press any key to continue.",
+ "of an already existing Partition!\n"
+ "\n"
+ " * Press any key to continue.",
NULL
},
{
@@ -1443,8 +1443,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup failed to find the 'SetupData' section\n"
- "in TXTSETUP.SIF.\n",
- "ENTER = Reboot computer"
+ "in TXTSETUP.SIF.\n",
+ "ENTER = Reboot computer"
},
{
//ERROR_WRITE_PTABLE,
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/lang/uk-UA.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/lang/uk-…
==============================================================================
--- trunk/reactos/base/setup/usetup/lang/uk-UA.h (original)
+++ trunk/reactos/base/setup/usetup/lang/uk-UA.h Tue Jan 8 00:34:56 2008
@@ -1270,12 +1270,12 @@
{
//ERROR_NOT_INSTALLED
"ReactOS is not completely installed on your\n"
- "computer. If you quit Setup now, you will need to\n"
- "run Setup again to install ReactOS.\n"
- "\n"
- " \x07 Press ENTER to continue Setup.\n"
- " \x07 Press F3 to quit Setup.",
- "F3= Quit ENTER = Continue"
+ "computer. If you quit Setup now, you will need to\n"
+ "run Setup again to install ReactOS.\n"
+ "\n"
+ " \x07 Press ENTER to continue Setup.\n"
+ " \x07 Press F3 to quit Setup.",
+ "F3= Quit ENTER = Continue"
},
{
//ERROR_NO_HDD
@@ -1334,21 +1334,21 @@
},
{
//ERROR_WARN_PARTITION,
- "Setup found that at least one harddisk contains an incompatible\n"
- "partition table that can not be handled properly!\n"
- "\n"
- "Creating or deleting partitions can destroy the partiton table.\n"
- "\n"
- " \x07 Press F3 to quit Setup."
- " \x07 Press ENTER to continue.",
- "F3= Quit ENTER = Continue"
+ "Setup found that at least one harddisk contains an incompatible\n"
+ "partition table that can not be handled properly!\n"
+ "\n"
+ "Creating or deleting partitions can destroy the partiton table.\n"
+ "\n"
+ " \x07 Press F3 to quit Setup."
+ " \x07 Press ENTER to continue.",
+ "F3= Quit ENTER = Continue"
},
{
//ERROR_NEW_PARTITION,
"You can not create a new Partition inside\n"
- "of an already existing Partition!\n"
- "\n"
- " * Press any key to continue.",
+ "of an already existing Partition!\n"
+ "\n"
+ " * Press any key to continue.",
NULL
},
{
@@ -1443,8 +1443,8 @@
{
//ERROR_FIND_SETUPDATA,
"Setup failed to find the 'SetupData' section\n"
- "in TXTSETUP.SIF.\n",
- "ENTER = Reboot computer"
+ "in TXTSETUP.SIF.\n",
+ "ENTER = Reboot computer"
},
{
//ERROR_WRITE_PTABLE,
@@ -1457,6 +1457,11 @@
"ENTER = Reboot computer"
},
{
+ //ERROR_UPDATE_LOCALESETTINGS,
+ "Setup could not set the system locale.\n"
+ "ENTER = Reboot computer"
+ },
+ {
NULL,
NULL
}
Modified: trunk/reactos/base/setup/usetup/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
==============================================================================
--- trunk/reactos/base/setup/usetup/settings.c (original)
+++ trunk/reactos/base/setup/usetup/settings.c Tue Jan 8 00:34:56 2008
@@ -20,7 +20,8 @@
* PROJECT: ReactOS text-mode setup
* FILE: subsys/system/usetup/settings.c
* PURPOSE: Device settings support functions
- * PROGRAMMER: Eric Kohl
+ * PROGRAMMERS: Eric Kohl
+ * Colin Finck
*/
/* INCLUDES *****************************************************************/
@@ -616,181 +617,15 @@
}
-PGENERIC_LIST
-CreateKeyboardDriverList(HINF InfFile)
-{
- CHAR Buffer[128];
- PGENERIC_LIST List;
- INFCONTEXT Context;
- PWCHAR KeyName;
- PWCHAR KeyValue;
- PWCHAR UserData;
-
- List = CreateGenericList();
- if (List == NULL)
- return NULL;
-
- if (!SetupFindFirstLineW (InfFile, L"Keyboard", NULL, &Context))
- {
- DestroyGenericList(List, FALSE);
- return NULL;
- }
-
- do
- {
- if (!INF_GetData (&Context, &KeyName, &KeyValue))
- {
- /* FIXME: Handle error! */
- DPRINT("INF_GetData() failed\n");
- break;
- }
-
- UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
- 0,
- (wcslen(KeyName) + 1) * sizeof(WCHAR));
- if (UserData == NULL)
- {
- /* FIXME: Handle error! */
- }
-
- wcscpy(UserData, KeyName);
-
- sprintf(Buffer, "%S", KeyValue);
- AppendGenericListEntry(List, Buffer, UserData, FALSE);
- } while (SetupFindNextLine(&Context, &Context));
-
- return List;
-}
-
-PGENERIC_LIST
-CreateLanguageList(HINF InfFile, WCHAR * DefaultLanguage)
-{
- CHAR Buffer[128];
- PGENERIC_LIST List;
- INFCONTEXT Context;
- PWCHAR KeyName;
- PWCHAR KeyValue;
- PWCHAR UserData;
-
- /* Get default language id */
- if (!SetupFindFirstLineW (InfFile, L"NLS", L"DefaultLanguage",
&Context))
- return NULL;
-
- if (!INF_GetData (&Context, NULL, &KeyValue))
- return NULL;
-
- wcscpy(DefaultLanguage, KeyValue);
-
- SelectedLanguageId = KeyValue;
-
- List = CreateGenericList();
- if (List == NULL)
- return NULL;
-
- if (!SetupFindFirstLineW (InfFile, L"Language", NULL, &Context))
- {
- DestroyGenericList(List, FALSE);
- return NULL;
- }
-
- do
- {
- if (!INF_GetData (&Context, &KeyName, &KeyValue))
- {
- /* FIXME: Handle error! */
- DPRINT("INF_GetData() failed\n");
- break;
- }
-
- UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
- 0,
- (wcslen(KeyName) + 1) * sizeof(WCHAR));
- if (UserData == NULL)
- {
- /* FIXME: Handle error! */
- }
-
- wcscpy(UserData, KeyName);
-
- sprintf(Buffer, "%S", KeyValue);
- AppendGenericListEntry(List,
- Buffer,
- UserData,
- _wcsicmp(KeyName, DefaultLanguage) ? FALSE : TRUE);
- } while (SetupFindNextLine(&Context, &Context));
-
- return List;
-}
-
-PGENERIC_LIST
-CreateKeyboardLayoutList(HINF InfFile, WCHAR * DefaultKBLayout)
-{
- CHAR Buffer[128];
- PGENERIC_LIST List;
- INFCONTEXT Context;
- PWCHAR KeyName;
- PWCHAR KeyValue;
- PWCHAR UserData;
-
- /* Get default layout id */
- if (!SetupFindFirstLineW (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;
-
- if (!SetupFindFirstLineW (InfFile, L"KeyboardLayout", NULL, &Context))
- {
- DestroyGenericList(List, FALSE);
- return NULL;
- }
-
- do
- {
- if (!INF_GetData (&Context, &KeyName, &KeyValue))
- {
- /* FIXME: Handle error! */
- DPRINT("INF_GetData() failed\n");
- DestroyGenericList(List, FALSE);
- break;
- }
-
- UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
- 0,
- (wcslen(KeyName) + 1) * sizeof(WCHAR));
-
- if (UserData == NULL)
- {
- /* FIXME: Handle error! */
- }
-
- wcscpy(UserData, KeyName);
-
- sprintf(Buffer, "%S", KeyValue);
- AppendGenericListEntry(List,
- Buffer,
- UserData,
- _wcsicmp(KeyName, DefaultKBLayout) ? FALSE : TRUE);
- } while (SetupFindNextLine(&Context, &Context));
-
- return List;
-}
-
-
BOOLEAN
-ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
+ProcessLocaleRegistry(PGENERIC_LIST List)
{
PGENERIC_LIST_ENTRY Entry;
PWCHAR LanguageId;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
UNICODE_STRING ValueName;
+
HANDLE KeyHandle;
NTSTATUS Status;
@@ -802,7 +637,7 @@
if (LanguageId == NULL)
return FALSE;
- /* Open the nls language key */
+ /* Open the NLS language key */
RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language");
@@ -861,6 +696,273 @@
}
+PGENERIC_LIST
+CreateKeyboardDriverList(HINF InfFile)
+{
+ CHAR Buffer[128];
+ PGENERIC_LIST List;
+ INFCONTEXT Context;
+ PWCHAR KeyName;
+ PWCHAR KeyValue;
+ PWCHAR UserData;
+
+ List = CreateGenericList();
+ if (List == NULL)
+ return NULL;
+
+ if (!SetupFindFirstLineW (InfFile, L"Keyboard", NULL, &Context))
+ {
+ DestroyGenericList(List, FALSE);
+ return NULL;
+ }
+
+ do
+ {
+ if (!INF_GetData (&Context, &KeyName, &KeyValue))
+ {
+ /* FIXME: Handle error! */
+ DPRINT("INF_GetData() failed\n");
+ break;
+ }
+
+ UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
+ 0,
+ (wcslen(KeyName) + 1) * sizeof(WCHAR));
+ if (UserData == NULL)
+ {
+ /* FIXME: Handle error! */
+ }
+
+ wcscpy(UserData, KeyName);
+
+ sprintf(Buffer, "%S", KeyValue);
+ AppendGenericListEntry(List, Buffer, UserData, FALSE);
+ } while (SetupFindNextLine(&Context, &Context));
+
+ return List;
+}
+
+PGENERIC_LIST
+CreateLanguageList(HINF InfFile, WCHAR * DefaultLanguage)
+{
+ CHAR Buffer[128];
+ PGENERIC_LIST List;
+ INFCONTEXT Context;
+ PWCHAR KeyName;
+ PWCHAR KeyValue;
+ PWCHAR UserData;
+
+ /* Get default language id */
+ if (!SetupFindFirstLineW (InfFile, L"NLS", L"DefaultLanguage",
&Context))
+ return NULL;
+
+ if (!INF_GetData (&Context, NULL, &KeyValue))
+ return NULL;
+
+ wcscpy(DefaultLanguage, KeyValue);
+
+ SelectedLanguageId = KeyValue;
+
+ List = CreateGenericList();
+ if (List == NULL)
+ return NULL;
+
+ if (!SetupFindFirstLineW (InfFile, L"Language", NULL, &Context))
+ {
+ DestroyGenericList(List, FALSE);
+ return NULL;
+ }
+
+ do
+ {
+ if (!INF_GetData (&Context, &KeyName, &KeyValue))
+ {
+ /* FIXME: Handle error! */
+ DPRINT("INF_GetData() failed\n");
+ break;
+ }
+
+ UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
+ 0,
+ (wcslen(KeyName) + 1) * sizeof(WCHAR));
+ if (UserData == NULL)
+ {
+ /* FIXME: Handle error! */
+ }
+
+ wcscpy(UserData, KeyName);
+
+ sprintf(Buffer, "%S", KeyValue);
+ AppendGenericListEntry(List,
+ Buffer,
+ UserData,
+ _wcsicmp(KeyName, DefaultLanguage) ? FALSE : TRUE);
+ } while (SetupFindNextLine(&Context, &Context));
+
+ return List;
+}
+
+PGENERIC_LIST
+CreateKeyboardLayoutList(HINF InfFile, WCHAR * DefaultKBLayout)
+{
+ CHAR Buffer[128];
+ PGENERIC_LIST List;
+ INFCONTEXT Context;
+ PWCHAR KeyName;
+ PWCHAR KeyValue;
+ PWCHAR UserData;
+
+ /* Get default layout id */
+ if (!SetupFindFirstLineW (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;
+
+ if (!SetupFindFirstLineW (InfFile, L"KeyboardLayout", NULL, &Context))
+ {
+ DestroyGenericList(List, FALSE);
+ return NULL;
+ }
+
+ do
+ {
+ if (!INF_GetData (&Context, &KeyName, &KeyValue))
+ {
+ /* FIXME: Handle error! */
+ DPRINT("INF_GetData() failed\n");
+ DestroyGenericList(List, FALSE);
+ break;
+ }
+
+ UserData = (WCHAR*) RtlAllocateHeap(ProcessHeap,
+ 0,
+ (wcslen(KeyName) + 1) * sizeof(WCHAR));
+
+ if (UserData == NULL)
+ {
+ /* FIXME: Handle error! */
+ }
+
+ wcscpy(UserData, KeyName);
+
+ sprintf(Buffer, "%S", KeyValue);
+ AppendGenericListEntry(List,
+ Buffer,
+ UserData,
+ _wcsicmp(KeyName, DefaultKBLayout) ? FALSE : TRUE);
+ } while (SetupFindNextLine(&Context, &Context));
+
+ return List;
+}
+
+
+BOOLEAN
+ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
+{
+ PGENERIC_LIST_ENTRY Entry;
+ PWCHAR LanguageId;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ UNICODE_STRING KeyName;
+ UNICODE_STRING ValueName;
+ ULONG Disposition;
+ HANDLE KeyHandle;
+ NTSTATUS Status;
+ WCHAR szKeyName[48] = L"\\Registry\\User\\.DEFAULT\\Keyboard Layout";
// 48 = "\Registry\User\.DEFAULT\Keyboard Layout\Preload" + NULL char
+
+ Entry = GetGenericListEntry(List);
+ if (Entry == NULL)
+ return FALSE;
+
+ LanguageId = (PWCHAR)Entry->UserData;
+ if (LanguageId == NULL)
+ return FALSE;
+
+ // First create the "Keyboard Layout" key
+ RtlInitUnicodeString(&KeyName, szKeyName);
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtCreateKey(&KeyHandle,
+ KEY_ALL_ACCESS,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ 0,
+ &Disposition);
+
+ if(NT_SUCCESS(Status))
+ NtClose(KeyHandle);
+ else
+ {
+ DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+ // Then create the "Preload" key
+ KeyName.MaximumLength = sizeof(szKeyName);
+ Status = RtlAppendUnicodeToString(&KeyName, L"\\Preload");
+
+ if(!NT_SUCCESS(Status))
+ {
+ DPRINT1("RtlAppend failed! (%lx)\n", Status);
+ DPRINT1("String is %wZ\n", &KeyName);
+ return FALSE;
+ }
+
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+
+ Status = NtCreateKey(&KeyHandle,
+ KEY_ALL_ACCESS,
+ &ObjectAttributes,
+ 0,
+ NULL,
+ 0,
+ &Disposition);
+
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtCreateKey() failed (Status %lx)\n", Status);
+ return FALSE;
+ }
+
+ /* Set default keyboard layout */
+ RtlInitUnicodeString(&ValueName,
+ L"1");
+
+ Status = NtSetValueKey(KeyHandle,
+ &ValueName,
+ 0,
+ REG_SZ,
+ (PVOID)LanguageId,
+ (8 + 1) * sizeof(WCHAR));
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
+ NtClose(KeyHandle);
+ return FALSE;
+ }
+
+ NtClose(KeyHandle);
+
+ return TRUE;
+}
+
+
#if 0
BOOLEAN
ProcessKeyboardLayoutFiles(PGENERIC_LIST List)
Modified: trunk/reactos/base/setup/usetup/settings.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/settings…
==============================================================================
--- trunk/reactos/base/setup/usetup/settings.h (original)
+++ trunk/reactos/base/setup/usetup/settings.h Tue Jan 8 00:34:56 2008
@@ -52,6 +52,9 @@
CreateLanguageList(HINF InfFile, WCHAR * DefaultLanguage);
BOOLEAN
+ProcessLocaleRegistry(PGENERIC_LIST List);
+
+BOOLEAN
ProcessKeyboardLayoutRegistry(PGENERIC_LIST List);
BOOLEAN
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c Tue Jan 8 00:34:56 2008
@@ -5,6 +5,7 @@
* FILE: subsystems/win32/win32k/ntuser/kbdlayout.c
* PURPOSE: Keyboard layout management
* COPYRIGHT: Copyright 2007 Saveliy Tretiakov
+ * Copyright 2008 Colin Finck
*
*/
@@ -53,7 +54,7 @@
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE,
NULL, NULL);
- Status = ZwOpenKey(&KeyHandle, KEY_ALL_ACCESS, &KeyAttributes);
+ Status = ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes);
if( !NT_SUCCESS(Status) )
{
return Status;
@@ -270,24 +271,77 @@
PKBL W32kGetDefaultKeyLayout(VOID)
{
- LCID LocaleId;
+ const WCHAR szKeyboardLayoutPath[] = L"\\Keyboard Layout\\Preload";
+
+ HANDLE KeyHandle;
+ LCID LayoutLocaleId = 0;
NTSTATUS Status;
+ OBJECT_ATTRIBUTES KeyAttributes;
PKBL pKbl;
-
- // This is probably wrong...
- // I need to do more research.
- Status = ZwQueryDefaultLocale(FALSE, &LocaleId);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Could not get default locale (%08lx).\n", Status);
- DPRINT1("Assuming default locale = 0x409 (US).\n");
- LocaleId = 0x409;
+ UNICODE_STRING CurrentUserPath;
+ UNICODE_STRING FullKeyboardLayoutPath;
+ UNICODE_STRING LayoutValueName;
+ UNICODE_STRING LayoutLocaleIdString;
+ WCHAR wszBuffer[MAX_PATH];
+
+ // Get the path to HKEY_CURRENT_USER
+ Status = RtlFormatCurrentUserKeyPath(&CurrentUserPath);
+
+ if( NT_SUCCESS(Status) )
+ {
+ // FIXME: Is this 100% correct?
+ // We're called very early, so \\REGISTRY\\USER might not be available yet.
Check this first.
+ InitializeObjectAttributes(&KeyAttributes, &CurrentUserPath,
OBJ_CASE_INSENSITIVE, NULL, NULL);
+ Status = ZwOpenKey(&KeyHandle, KEY_READ, &KeyAttributes);
+
+ if(Status == STATUS_OBJECT_NAME_NOT_FOUND)
+ {
+ // Fall back to US English without any debug message
+ LayoutLocaleId = 0x409;
+ }
+ else
+ {
+ // The path is available, so build the full path to HKEY_CURRENT_USER\Keyboard
Layout\Preload
+ ZwClose(KeyHandle);
+
+ RtlCopyMemory(wszBuffer, CurrentUserPath.Buffer,
CurrentUserPath.MaximumLength);
+ RtlInitUnicodeString(&FullKeyboardLayoutPath, wszBuffer);
+ FullKeyboardLayoutPath.MaximumLength = MAX_PATH;
+
+ Status = RtlAppendUnicodeToString(&FullKeyboardLayoutPath,
szKeyboardLayoutPath);
+
+ if( NT_SUCCESS(Status) )
+ {
+ // Return the first keyboard layout listed there
+ RtlInitUnicodeString(&LayoutValueName, L"1");
+
+ Status = ReadRegistryValue(&FullKeyboardLayoutPath, &LayoutValueName,
&LayoutLocaleIdString);
+
+ if( NT_SUCCESS(Status) )
+ RtlUnicodeStringToInteger(&LayoutLocaleIdString, 16,
&LayoutLocaleId);
+ else
+ DPRINT1("ReadRegistryValue failed! (%08lx).\n", Status);
+ }
+ else
+ DPRINT1("RtlAppendUnicodeToString failed! (%08lx)\n", Status);
+ }
+
+ RtlFreeUnicodeString(&CurrentUserPath);
+ }
+ else
+ DPRINT1("RtlFormatCurrentUserKeyPath failed! (%08lx)\n", Status);
+
+ if(!LayoutLocaleId)
+ {
+ // This block is only reached in case of a failure, so use DPRINT1 here
+ DPRINT1("Assuming default locale for the keyboard layout (0x409 -
US)\n");
+ LayoutLocaleId = 0x409;
}
pKbl = KBLList;
do
{
- if(pKbl->klid == LocaleId)
+ if(pKbl->klid == LayoutLocaleId)
{
return pKbl;
}
@@ -296,11 +350,11 @@
} while(pKbl != KBLList);
DPRINT("Loading new default keyboard layout.\n");
- pKbl = UserLoadDllAndCreateKbl(LocaleId);
+ pKbl = UserLoadDllAndCreateKbl(LayoutLocaleId);
if(!pKbl)
{
- DPRINT("Failed to load %x!!! Returning any availableKL.\n", LocaleId);
+ DPRINT("Failed to load %x!!! Returning any availableKL.\n",
LayoutLocaleId);
return KBLList;
}