[ros-diffs] [fireball] 40030: - Implement NLS data loading.
fireball at svn.reactos.org
fireball at svn.reactos.org
Sun Mar 15 12:10:53 CET 2009
Author: fireball
Date: Sun Mar 15 14:10:52 2009
New Revision: 40030
URL: http://svn.reactos.org/svn/reactos?rev=40030&view=rev
Log:
- Implement NLS data loading.
Modified:
trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c
Modified: trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c?rev=40030&r1=40029&r2=40030&view=diff
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/windows/setupldr2.c [iso-8859-1] Sun Mar 15 14:10:52 2009
@@ -36,6 +36,12 @@
PCHAR SystemPath,
PCHAR BootPath,
USHORT VersionToBoot);
+BOOLEAN
+WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
+ IN LPCSTR DirectoryPath,
+ IN LPCSTR AnsiFileName,
+ IN LPCSTR OemFileName,
+ IN LPCSTR LanguageFileName);
@@ -46,6 +52,53 @@
extern BOOLEAN UseRealHeap;
extern ULONG LoaderPagesSpanned;
+
+
+VOID
+SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath)
+{
+ INFCONTEXT InfContext;
+ BOOLEAN Status;
+ LPCSTR AnsiName, OemName, LangName;
+
+ /* Get ANSI codepage file */
+ if (!InfFindFirstLine(InfHandle, "NLS", "AnsiCodepage", &InfContext))
+ {
+ printf("Failed to find 'NLS/AnsiCodepage'\n");
+ return;
+ }
+ if (!InfGetDataField(&InfContext, 1, &AnsiName))
+ {
+ printf("Failed to get load options\n");
+ return;
+ }
+
+ /* Get OEM codepage file */
+ if (!InfFindFirstLine(InfHandle, "NLS", "OemCodepage", &InfContext))
+ {
+ printf("Failed to find 'NLS/AnsiCodepage'\n");
+ return;
+ }
+ if (!InfGetDataField(&InfContext, 1, &OemName))
+ {
+ printf("Failed to get load options\n");
+ return;
+ }
+
+ if (!InfFindFirstLine(InfHandle, "NLS", "UnicodeCasetable", &InfContext))
+ {
+ printf("Failed to find 'NLS/AnsiCodepage'\n");
+ return;
+ }
+ if (!InfGetDataField(&InfContext, 1, &LangName))
+ {
+ printf("Failed to get load options\n");
+ return;
+ }
+
+ Status = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
+ DPRINTM(DPRINT_WINDOWS, "NLS data loaded with status %d\n", Status);
+}
VOID LoadReactOSSetup2(VOID)
{
@@ -183,9 +236,8 @@
if (KdComDTE)
WinLdrScanImportDescriptorTable(LoaderBlock, SearchPath, KdComDTE);
- /* Load Hive, and then NLS data, OEM font, and prepare boot drivers list */
- //Status = WinLdrLoadAndScanSystemHive(LoaderBlock, BootPath);
- DPRINTM(DPRINT_WINDOWS, "SYSTEM hive loaded and scanned with status %d\n", Status);
+ /* Load NLS data */
+ SetupLdrLoadNlsData(LoaderBlock, InfHandle, BootPath);
/* Load boot drivers */
//Status = WinLdrLoadBootDrivers(LoaderBlock, BootPath);
More information about the Ros-diffs
mailing list