This patch adds actually informative messages about what went wrong loading

the registry entries for NLS files, etc.

svn path=/trunk/; revision=10733
This commit is contained in:
Art Yerkes 2004-08-29 18:29:48 +00:00
parent cb968187d0
commit e78fa73912

View file

@ -349,7 +349,7 @@ LoadBootDrivers(PCHAR szSystemRoot, int nPos)
static BOOL static BOOL
LoadNlsFiles(PCHAR szSystemRoot) LoadNlsFiles(PCHAR szSystemRoot, PCHAR szErrorOut)
{ {
S32 rc = ERROR_SUCCESS; S32 rc = ERROR_SUCCESS;
HKEY hKey; HKEY hKey;
@ -362,77 +362,96 @@ LoadNlsFiles(PCHAR szSystemRoot)
rc = RegOpenKey(NULL, rc = RegOpenKey(NULL,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage", "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage",
&hKey); &hKey);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "Couldn't open CodePage registry key");
return(FALSE);
}
/* get ANSI codepage */ /* get ANSI codepage */
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, "ACP", NULL, (PUCHAR)szIdBuffer, &BufferSize); rc = RegQueryValue(hKey, "ACP", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "Couldn't get ACP NLS setting");
return(FALSE);
}
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize); rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "ACP NLS Setting exists, but isn't readable");
return(FALSE);
}
/* load ANSI codepage table */ /* load ANSI codepage table */
strcpy(szFileName, szSystemRoot); strcpy(szFileName, szSystemRoot);
strcat(szFileName, "system32\\"); strcat(szFileName, "system32\\");
strcat(szFileName, szNameBuffer); strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "ANSI file: %s\n", szFileName)); DbgPrint((DPRINT_REACTOS, "ANSI file: %s\n", szFileName));
if (!LoadNlsFile(szFileName, "ansi.nls")) if (!LoadNlsFile(szFileName, "ansi.nls")) {
return(FALSE); strcpy(szErrorOut, "Couldn't load ansi.nls");
return(FALSE);
}
/* get OEM codepage */ /* get OEM codepage */
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, "OEMCP", NULL, (PUCHAR)szIdBuffer, &BufferSize); rc = RegQueryValue(hKey, "OEMCP", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "Couldn't get OEMCP NLS setting");
return(FALSE);
}
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize); rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "OEMCP NLS setting exists, but isn't readable");
return(FALSE);
}
/* load OEM codepage table */ /* load OEM codepage table */
strcpy(szFileName, szSystemRoot); strcpy(szFileName, szSystemRoot);
strcat(szFileName, "system32\\"); strcat(szFileName, "system32\\");
strcat(szFileName, szNameBuffer); strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "Oem file: %s\n", szFileName)); DbgPrint((DPRINT_REACTOS, "Oem file: %s\n", szFileName));
if (!LoadNlsFile(szFileName, "oem.nls")) if (!LoadNlsFile(szFileName, "oem.nls")) {
return(FALSE); strcpy(szErrorOut, "Couldn't load oem.nls");
return(FALSE);
}
/* open the language key */ /* open the language key */
rc = RegOpenKey(NULL, rc = RegOpenKey(NULL,
"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language", "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language",
&hKey); &hKey);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "Couldn't open Language registry key");
return(FALSE);
}
/* get the Unicode case table */ /* get the Unicode case table */
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, "Default", NULL, (PUCHAR)szIdBuffer, &BufferSize); rc = RegQueryValue(hKey, "Default", NULL, (PUCHAR)szIdBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut, "Couldn't get Language Default setting");
return(FALSE);
}
BufferSize = 80; BufferSize = 80;
rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize); rc = RegQueryValue(hKey, szIdBuffer, NULL, (PUCHAR)szNameBuffer, &BufferSize);
if (rc != ERROR_SUCCESS) if (rc != ERROR_SUCCESS) {
return(FALSE); strcpy(szErrorOut,
"Language Default setting exists, but isn't readable");
return(FALSE);
}
/* load Unicode case table */ /* load Unicode case table */
strcpy(szFileName, szSystemRoot); strcpy(szFileName, szSystemRoot);
strcat(szFileName, "system32\\"); strcat(szFileName, "system32\\");
strcat(szFileName, szNameBuffer); strcat(szFileName, szNameBuffer);
DbgPrint((DPRINT_REACTOS, "Casemap file: %s\n", szFileName)); DbgPrint((DPRINT_REACTOS, "Casemap file: %s\n", szFileName));
if (!LoadNlsFile(szFileName, "casemap.nls")) if (!LoadNlsFile(szFileName, "casemap.nls")) {
return(FALSE); strcpy(szErrorOut, "casemap.nls");
return(FALSE);
}
return(TRUE); return(TRUE);
} }
@ -731,9 +750,9 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
/* /*
* Load NLS files * Load NLS files
*/ */
if (!LoadNlsFiles(szBootPath)) if (!LoadNlsFiles(szBootPath, MsgBuffer))
{ {
UiMessageBox("Could not load the NLS files!\n"); UiMessageBox(MsgBuffer);
return; return;
} }
UiDrawProgressBarCenter(25, 100, "Loading ReactOS..."); UiDrawProgressBarCenter(25, 100, "Loading ReactOS...");