- 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
This commit is contained in:
Eric Kohl 2010-04-26 15:10:23 +00:00
parent 17557bfabd
commit 9721d8084b
6 changed files with 19 additions and 3 deletions

View file

@ -132,6 +132,7 @@ InfpOpenInfFileW(
IN PCWSTR FileName, IN PCWSTR FileName,
IN PCWSTR InfClass, IN PCWSTR InfClass,
IN DWORD InfStyle, IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine) OUT PUINT ErrorLine)
{ {
HINF hInf = NULL; HINF hInf = NULL;
@ -143,6 +144,7 @@ InfpOpenInfFileW(
Status = InfOpenFile( Status = InfOpenFile(
&hInf, &hInf,
&FileNameU, &FileNameU,
LocaleId,
&ErrorLineUL); &ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL; *ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
@ -252,6 +254,7 @@ INF_OpenBufferedFileA(
IN ULONG FileSize, IN ULONG FileSize,
IN PCSTR InfClass, IN PCSTR InfClass,
IN DWORD InfStyle, IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine) OUT PUINT ErrorLine)
{ {
#ifdef __REACTOS__ #ifdef __REACTOS__
@ -263,6 +266,7 @@ INF_OpenBufferedFileA(
&hInf, &hInf,
FileBuffer, FileBuffer,
FileSize, FileSize,
LocaleId,
&ErrorLineUL); &ErrorLineUL);
*ErrorLine = (UINT)ErrorLineUL; *ErrorLine = (UINT)ErrorLineUL;
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))

View file

@ -110,6 +110,7 @@ InfpOpenInfFileW(
IN PCWSTR FileName, IN PCWSTR FileName,
IN PCWSTR InfClass, IN PCWSTR InfClass,
IN DWORD InfStyle, IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine); OUT PUINT ErrorLine);
#endif /* __REACTOS__ */ #endif /* __REACTOS__ */
@ -132,6 +133,7 @@ INF_OpenBufferedFileA(
IN ULONG FileSize, IN ULONG FileSize,
IN PCSTR InfClass, IN PCSTR InfClass,
IN DWORD InfStyle, IN DWORD InfStyle,
IN LCID LocaleId,
OUT PUINT ErrorLine); OUT PUINT ErrorLine);
VOID INF_SetHeap( VOID INF_SetHeap(

View file

@ -79,6 +79,8 @@ static PGENERIC_LIST KeyboardList = NULL;
static PGENERIC_LIST LayoutList = NULL; static PGENERIC_LIST LayoutList = NULL;
static PGENERIC_LIST LanguageList = NULL; static PGENERIC_LIST LanguageList = NULL;
static LANGID LanguageId = 0;
/* FUNCTIONS ****************************************************************/ /* FUNCTIONS ****************************************************************/
static VOID static VOID
@ -422,6 +424,7 @@ CheckUnattendedSetup(VOID)
UnattendInf = SetupOpenInfFileW(UnattendInfPath, UnattendInf = SetupOpenInfFileW(UnattendInfPath,
NULL, NULL,
INF_STYLE_WIN4, INF_STYLE_WIN4,
LanguageId,
&ErrorLine); &ErrorLine);
if (UnattendInf == INVALID_HANDLE_VALUE) if (UnattendInf == INVALID_HANDLE_VALUE)
@ -678,6 +681,8 @@ LanguagePage(PINPUT_RECORD Ir)
{ {
SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList)); SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
if (wcscmp(SelectedLanguageId, DefaultLanguage)) if (wcscmp(SelectedLanguageId, DefaultLanguage))
{ {
UpdateKBLayout(); UpdateKBLayout();
@ -765,6 +770,7 @@ SetupStartPage(PINPUT_RECORD Ir)
SetupInf = SetupOpenInfFileW(FileNameBuffer, SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL, NULL,
INF_STYLE_WIN4, INF_STYLE_WIN4,
LanguageId,
&ErrorLine); &ErrorLine);
if (SetupInf == INVALID_HANDLE_VALUE) if (SetupInf == INVALID_HANDLE_VALUE)
@ -3045,6 +3051,7 @@ PrepareCopyPage(PINPUT_RECORD Ir)
InfFileSize, InfFileSize,
(const CHAR*) NULL, (const CHAR*) NULL,
INF_STYLE_WIN4, INF_STYLE_WIN4,
LanguageId,
&ErrorLine); &ErrorLine);
if (InfHandle == INVALID_HANDLE_VALUE) if (InfHandle == INVALID_HANDLE_VALUE)
@ -3274,7 +3281,7 @@ RegistryPage(PINPUT_RECORD Ir)
CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File); CONSOLE_SetStatusText(MUIGetString(STRING_IMPORTFILE), File);
if (!ImportRegistryFile(File, Section, Delete)) if (!ImportRegistryFile(File, Section, LanguageId, Delete))
{ {
DPRINT("Importing %S failed\n", File); DPRINT("Importing %S failed\n", File);

View file

@ -617,6 +617,7 @@ registry_callback (HINF hInf, PCWSTR Section, BOOLEAN Delete)
BOOLEAN BOOLEAN
ImportRegistryFile(PWSTR Filename, ImportRegistryFile(PWSTR Filename,
PWSTR Section, PWSTR Section,
LCID LocaleId,
BOOLEAN Delete) BOOLEAN Delete)
{ {
WCHAR FileNameBuffer[MAX_PATH]; WCHAR FileNameBuffer[MAX_PATH];
@ -632,6 +633,7 @@ ImportRegistryFile(PWSTR Filename,
FileNameBuffer, FileNameBuffer,
NULL, NULL,
INF_STYLE_WIN4, INF_STYLE_WIN4,
LocaleId,
&ErrorLine); &ErrorLine);
if (hInf == INVALID_HANDLE_VALUE) if (hInf == INVALID_HANDLE_VALUE)
{ {

View file

@ -29,6 +29,7 @@
BOOLEAN BOOLEAN
ImportRegistryFile(PWSTR Filename, ImportRegistryFile(PWSTR Filename,
PWSTR Section, PWSTR Section,
LCID LocaleId,
BOOLEAN Delete); BOOLEAN Delete);
BOOLEAN BOOLEAN

View file

@ -4,10 +4,10 @@
<bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" /> <bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" />
<include base="usetup">.</include> <include base="usetup">.</include>
<include base="zlib">.</include> <include base="zlib">.</include>
<include base="inflib">.</include> <include base="newinflib">.</include>
<include base="ReactOS">include/reactos/drivers</include> <include base="ReactOS">include/reactos/drivers</include>
<library>zlib</library> <library>zlib</library>
<library>inflib</library> <library>newinflib</library>
<library>ext2lib</library> <library>ext2lib</library>
<library>vfatlib</library> <library>vfatlib</library>
<library>ntdll</library> <library>ntdll</library>