Author: ekohl
Date: Mon Apr 26 17:10:23 2010
New Revision: 47037
URL:
http://svn.reactos.org/svn/reactos?rev=47037&view=rev
Log:
[USETUP]
- 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.
Modified:
trunk/reactos/base/setup/usetup/inffile.c
trunk/reactos/base/setup/usetup/inffile.h
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/base/setup/usetup/registry.c
trunk/reactos/base/setup/usetup/registry.h
trunk/reactos/base/setup/usetup/usetup.rbuild
Modified: trunk/reactos/base/setup/usetup/inffile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.…
==============================================================================
--- trunk/reactos/base/setup/usetup/inffile.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/inffile.c [iso-8859-1] Mon Apr 26 17:10:23 2010
@@ -132,6 +132,7 @@
IN PCWSTR FileName,
IN PCWSTR InfClass,
IN DWORD InfStyle,
+ IN LCID LocaleId,
OUT PUINT ErrorLine)
{
HINF hInf = NULL;
@@ -143,6 +144,7 @@
Status = InfOpenFile(
&hInf,
&FileNameU,
+ LocaleId,
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
@@ -252,6 +254,7 @@
IN ULONG FileSize,
IN PCSTR InfClass,
IN DWORD InfStyle,
+ IN LCID LocaleId,
OUT PUINT ErrorLine)
{
#ifdef __REACTOS__
@@ -263,6 +266,7 @@
&hInf,
FileBuffer,
FileSize,
+ LocaleId,
&ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status))
Modified: trunk/reactos/base/setup/usetup/inffile.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inffile.…
==============================================================================
--- trunk/reactos/base/setup/usetup/inffile.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/inffile.h [iso-8859-1] Mon Apr 26 17:10:23 2010
@@ -110,6 +110,7 @@
IN PCWSTR FileName,
IN PCWSTR InfClass,
IN DWORD InfStyle,
+ IN LCID LocaleId,
OUT PUINT ErrorLine);
#endif /* __REACTOS__ */
@@ -132,6 +133,7 @@
IN ULONG FileSize,
IN PCSTR InfClass,
IN DWORD InfStyle,
+ IN LCID LocaleId,
OUT PUINT ErrorLine);
VOID INF_SetHeap(
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 [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Mon Apr 26 17:10:23
2010
@@ -79,6 +79,8 @@
static PGENERIC_LIST LayoutList = NULL;
static PGENERIC_LIST LanguageList = NULL;
+static LANGID LanguageId = 0;
+
/* FUNCTIONS ****************************************************************/
static VOID
@@ -422,6 +424,7 @@
UnattendInf = SetupOpenInfFileW(UnattendInfPath,
NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (UnattendInf == INVALID_HANDLE_VALUE)
@@ -677,6 +680,8 @@
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
SelectedLanguageId =
(PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+
+ LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
if (wcscmp(SelectedLanguageId, DefaultLanguage))
{
@@ -765,6 +770,7 @@
SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (SetupInf == INVALID_HANDLE_VALUE)
@@ -3045,6 +3051,7 @@
InfFileSize,
(const CHAR*) NULL,
INF_STYLE_WIN4,
+ LanguageId,
&ErrorLine);
if (InfHandle == INVALID_HANDLE_VALUE)
@@ -3274,7 +3281,7 @@
CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File);
- if (!ImportRegistryFile(File, Section, Delete))
+ if (!ImportRegistryFile(File, Section, LanguageId, Delete))
{
DPRINT("Importing %S failed\n", File);
Modified: trunk/reactos/base/setup/usetup/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
==============================================================================
--- trunk/reactos/base/setup/usetup/registry.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/registry.c [iso-8859-1] Mon Apr 26 17:10:23 2010
@@ -617,6 +617,7 @@
BOOLEAN
ImportRegistryFile(PWSTR Filename,
PWSTR Section,
+ LCID LocaleId,
BOOLEAN Delete)
{
WCHAR FileNameBuffer[MAX_PATH];
@@ -632,6 +633,7 @@
FileNameBuffer,
NULL,
INF_STYLE_WIN4,
+ LocaleId,
&ErrorLine);
if (hInf == INVALID_HANDLE_VALUE)
{
Modified: trunk/reactos/base/setup/usetup/registry.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/registry…
==============================================================================
--- trunk/reactos/base/setup/usetup/registry.h [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/registry.h [iso-8859-1] Mon Apr 26 17:10:23 2010
@@ -29,6 +29,7 @@
BOOLEAN
ImportRegistryFile(PWSTR Filename,
PWSTR Section,
+ LCID LocaleId,
BOOLEAN Delete);
BOOLEAN
Modified: trunk/reactos/base/setup/usetup/usetup.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/usetup.r…
==============================================================================
--- trunk/reactos/base/setup/usetup/usetup.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/usetup.rbuild [iso-8859-1] Mon Apr 26 17:10:23 2010
@@ -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>