[USETUP]
authorEric Kohl <eric.kohl@reactos.org>
Mon, 26 Apr 2010 15:10:23 +0000 (15:10 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 26 Apr 2010 15:10:23 +0000 (15:10 +0000)
- Use newinflib instead of inflib.
- Pass the user-selected language to the inf parser.
- Convert registry code from ANSI APIs to UNICODE APIs.
ATTENTION: This commit might break the build bot because it was not tested on a Linux system.

svn path=/trunk/; revision=47037

reactos/base/setup/usetup/inffile.c
reactos/base/setup/usetup/inffile.h
reactos/base/setup/usetup/interface/usetup.c
reactos/base/setup/usetup/registry.c
reactos/base/setup/usetup/registry.h
reactos/base/setup/usetup/usetup.rbuild

index 51fe2e7..0bbde01 100644 (file)
@@ -132,6 +132,7 @@ InfpOpenInfFileW(
        IN PCWSTR FileName,
        IN PCWSTR InfClass,
        IN DWORD InfStyle,
+       IN LCID LocaleId,
        OUT PUINT ErrorLine)
 {
        HINF hInf = NULL;
@@ -143,6 +144,7 @@ InfpOpenInfFileW(
        Status = InfOpenFile(
                &hInf,
                &FileNameU,
+               LocaleId,
                &ErrorLineUL);
        *ErrorLine = (UINT)ErrorLineUL;
        if (!NT_SUCCESS(Status))
@@ -252,6 +254,7 @@ INF_OpenBufferedFileA(
        IN ULONG FileSize,
        IN PCSTR InfClass,
        IN DWORD InfStyle,
+       IN LCID LocaleId,
        OUT PUINT ErrorLine)
 {
 #ifdef __REACTOS__
@@ -263,6 +266,7 @@ INF_OpenBufferedFileA(
                &hInf,
                FileBuffer,
                FileSize,
+               LocaleId,
                &ErrorLineUL);
        *ErrorLine = (UINT)ErrorLineUL;
        if (!NT_SUCCESS(Status))
index 52b002d..864d201 100644 (file)
@@ -110,6 +110,7 @@ InfpOpenInfFileW(
        IN PCWSTR FileName,
        IN PCWSTR InfClass,
        IN DWORD InfStyle,
+       IN LCID LocaleId,
        OUT PUINT ErrorLine);
 
 #endif /* __REACTOS__ */
@@ -132,6 +133,7 @@ INF_OpenBufferedFileA(
        IN ULONG FileSize,
        IN PCSTR InfClass,
        IN DWORD InfStyle,
+       IN LCID LocaleId,
        OUT PUINT ErrorLine);
 
 VOID INF_SetHeap(
index 87df416..ea1711e 100644 (file)
@@ -79,6 +79,8 @@ static PGENERIC_LIST KeyboardList = NULL;
 static PGENERIC_LIST LayoutList = NULL;
 static PGENERIC_LIST LanguageList = NULL;
 
+static LANGID LanguageId = 0;
+
 /* FUNCTIONS ****************************************************************/
 
 static VOID
@@ -422,6 +424,7 @@ CheckUnattendedSetup(VOID)
     UnattendInf = SetupOpenInfFileW(UnattendInfPath,
                                     NULL,
                                     INF_STYLE_WIN4,
+                                    LanguageId,
                                     &ErrorLine);
 
     if (UnattendInf == INVALID_HANDLE_VALUE)
@@ -678,6 +681,8 @@ LanguagePage(PINPUT_RECORD Ir)
         {
             SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
 
+            LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
+
             if (wcscmp(SelectedLanguageId, DefaultLanguage))
             {
                 UpdateKBLayout();
@@ -765,6 +770,7 @@ SetupStartPage(PINPUT_RECORD Ir)
     SetupInf = SetupOpenInfFileW(FileNameBuffer,
                                  NULL,
                                  INF_STYLE_WIN4,
+                                 LanguageId,
                                  &ErrorLine);
 
     if (SetupInf == INVALID_HANDLE_VALUE)
@@ -3045,6 +3051,7 @@ PrepareCopyPage(PINPUT_RECORD Ir)
                                           InfFileSize,
                                           (const CHAR*) NULL,
                                           INF_STYLE_WIN4,
+                                          LanguageId,
                                           &ErrorLine);
 
         if (InfHandle == INVALID_HANDLE_VALUE)
@@ -3274,7 +3281,7 @@ RegistryPage(PINPUT_RECORD Ir)
 
         CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File);
 
-        if (!ImportRegistryFile(File, Section, Delete))
+        if (!ImportRegistryFile(File, Section, LanguageId, Delete))
         {
             DPRINT("Importing %S failed\n", File);
 
index d313b4d..a808129 100644 (file)
@@ -617,6 +617,7 @@ registry_callback (HINF hInf, PCWSTR Section, BOOLEAN Delete)
 BOOLEAN
 ImportRegistryFile(PWSTR Filename,
                    PWSTR Section,
+                   LCID LocaleId,
                    BOOLEAN Delete)
 {
   WCHAR FileNameBuffer[MAX_PATH];
@@ -632,6 +633,7 @@ ImportRegistryFile(PWSTR Filename,
                        FileNameBuffer,
                        NULL,
                        INF_STYLE_WIN4,
+                       LocaleId,
                        &ErrorLine);
   if (hInf == INVALID_HANDLE_VALUE)
     {
index d764704..63d2b67 100644 (file)
@@ -29,6 +29,7 @@
 BOOLEAN
 ImportRegistryFile(PWSTR Filename,
                   PWSTR Section,
+                  LCID LocaleId,
                   BOOLEAN Delete);
 
 BOOLEAN
index fa96c8c..51f3c03 100644 (file)
@@ -4,10 +4,10 @@
        <bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" />
        <include base="usetup">.</include>
        <include base="zlib">.</include>
-       <include base="inflib">.</include>
+       <include base="newinflib">.</include>
        <include base="ReactOS">include/reactos/drivers</include>
        <library>zlib</library>
-       <library>inflib</library>
+       <library>newinflib</library>
        <library>ext2lib</library>
        <library>vfatlib</library>
        <library>ntdll</library>