- Added ACP, OEMCP and MACCP keys to registry

- Added ERROR_ADDING_CODEPAGE to all languages
- Update Russian translation

svn path=/trunk/; revision=31642
This commit is contained in:
Dmitry Chapyshev 2008-01-07 14:51:42 +00:00
parent a173909f74
commit 00fe6ccc98
15 changed files with 395 additions and 234 deletions

View file

@ -62,6 +62,7 @@ typedef enum
ERROR_CREATE_INSTALL_DIR,
ERROR_FIND_SETUPDATA,
ERROR_WRITE_PTABLE,
ERROR_ADDING_CODEPAGE,
ERROR_LAST_ERROR_CODE
}ERROR_NUMBER;

View file

@ -3093,6 +3093,14 @@ RegistryPage(PINPUT_RECORD Ir)
return QUIT_PAGE;
}
/* Add codepage information to registry */
CONSOLE_SetStatusText(" Adding codepage information to registry...");
if (!AddCodePage())
{
MUIDisplayError(ERROR_ADDING_CODEPAGE, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}
/* Update the mounted devices list */
SetMountedDeviceValues(PartitionList);

View file

@ -1457,6 +1457,11 @@ MUI_ERROR deDEErrorEntries[] =
"Setup konnte die Partitionstabellen nicht schreiben.\n"
"ENTER = Computer neustarten"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1451,6 +1451,11 @@ MUI_ERROR elGRErrorEntries[] =
"Η Εγκατάσταση απέτυχε να γράψει τα partition tables.\n"
"ENTER = Επανεκκίνηση υπολογιστή"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1275,7 +1275,7 @@ MUI_ERROR enUSErrorEntries[] =
"\n"
" \x07 Press ENTER to continue Setup.\n"
" \x07 Press F3 to quit Setup.",
"F3= Quit ENTER = Continue"
"F3 = Quit ENTER = Continue"
},
{
//ERROR_NO_HDD
@ -1451,6 +1451,11 @@ MUI_ERROR enUSErrorEntries[] =
"Setup failed to write partition tables.\n"
"ENTER = Reboot computer"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1451,6 +1451,11 @@ MUI_ERROR esESErrorEntries[] =
"Setup failed to write partition tables.\n"
"ENTER = Reboot computer"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1463,6 +1463,11 @@ MUI_ERROR frFRErrorEntries[] =
"Setup n'a pu ecrire les tables de partition.\n"
"ENTER = Redemarrer l'ordinateur"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1457,6 +1457,11 @@ MUI_ERROR itITErrorEntries[] =
"Setup non ha potuto scrivere le tabelle di partizioni.\n"
"INVIO = Riavviare il computer"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1459,6 +1459,11 @@ MUI_ERROR plPLErrorEntries[] =
"Instalator nie móg³ zapisaæ zmian w tablicy partycji.\n"
"ENTER = Restart komputera"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

File diff suppressed because it is too large Load diff

View file

@ -1451,6 +1451,11 @@ MUI_ERROR svSEErrorEntries[] =
"Setup failed to write partition tables.\n"
"ENTER = Reboot computer"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -1451,6 +1451,11 @@ MUI_ERROR ukUAErrorEntries[] =
"Setup failed to write partition tables.\n"
"ENTER = Reboot computer"
},
{
//ERROR_ADDING_CODEPAGE,
"Setup failed to add codepage to registry.\n"
"ENTER = Reboot computer"
},
{
NULL,
NULL

View file

@ -28,6 +28,9 @@
#include "errorcode.h"
#include "mui.h"
#define NDEBUG
#include <debug.h>
#include "lang/en-US.h"
#include "lang/de-DE.h"
#include "lang/el-GR.h"
@ -308,4 +311,99 @@ MUIDisplayError(ULONG ErrorNum, PINPUT_RECORD Ir, ULONG WaitEvent)
WaitEvent);
}
static BOOLEAN
AddCodepageToRegistry(PWCHAR ACPage, PWCHAR OEMCPage, PWCHAR MACCPage)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
UNICODE_STRING ValueName;
HANDLE KeyHandle;
NTSTATUS Status;
// Open the nls codepage key
RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenKey(&KeyHandle,
KEY_ALL_ACCESS,
&ObjectAttributes);
if (!NT_SUCCESS(Status))
{
DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
return FALSE;
}
// Set ANSI codepage
RtlInitUnicodeString(&ValueName, L"ACP");
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
(PVOID)ACPage,
4 * sizeof(PWCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
NtClose(KeyHandle);
return FALSE;
}
// Set OEM codepage
RtlInitUnicodeString(&ValueName, L"OEMCP");
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
(PVOID)OEMCPage,
3 * sizeof(PWCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
NtClose(KeyHandle);
return FALSE;
}
// Set MAC codepage
RtlInitUnicodeString(&ValueName, L"MACCP");
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
(PVOID)MACCPage,
5 * sizeof(PWCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
NtClose(KeyHandle);
return FALSE;
}
NtClose(KeyHandle);
return TRUE;
}
BOOLEAN
AddCodePage(VOID)
{
ULONG lngIndex = 0;
do
{
if (_wcsicmp(LanguageList[lngIndex].LanguageID , SelectedLanguageId) == 0)
{
return AddCodepageToRegistry(LanguageList[lngIndex].ACPage,
LanguageList[lngIndex].OEMCPage,
LanguageList[lngIndex].MACCPage);
}
lngIndex++;
}
while (LanguageList[lngIndex].MuiPages != NULL);
return FALSE;
}
/* EOF */

View file

@ -53,5 +53,8 @@ MUIDisplayError (ULONG ErrorNum, PINPUT_RECORD Ir, ULONG WaitEvent);
VOID
MUIDefaultKeyboardLayout(WCHAR * KeyboardLayout);
BOOLEAN
AddCodePage(VOID);
#endif

View file

@ -821,7 +821,7 @@ ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
0,
REG_SZ,
(PVOID)(LanguageId + 4),
8);
8 * sizeof(PWCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
@ -837,7 +837,7 @@ ProcessKeyboardLayoutRegistry(PGENERIC_LIST List)
0,
REG_SZ,
(PVOID)(LanguageId + 4),
8);
8 * sizeof(PWCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);