mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[BOOTDATA][SETUPLIB][REACTOS] INF support fixes.
- BOOTDATA: Use standard INF signature string, so that they can be opened successfully using ReactOS' or Windows' setupapi.dll with the INF_STYLE_WIN4 style. - SETUPLIB: Use the correct INF_STYLE_* INF styles in SpInfOpenInfFile() calls. - REACTOS : Switch thread locale to user-specified LocaleId when calling SetupOpenInfFileW(), so that the correct localized strings are used.
This commit is contained in:
parent
42758b303b
commit
86f31289ef
14 changed files with 42 additions and 20 deletions
|
@ -783,7 +783,7 @@ PrepareFileCopy(
|
||||||
|
|
||||||
InfHandle = SpInfOpenInfFile(PathBuffer,
|
InfHandle = SpInfOpenInfFile(PathBuffer,
|
||||||
NULL,
|
NULL,
|
||||||
INF_STYLE_OLDNT, // INF_STYLE_WIN4,
|
INF_STYLE_WIN4,
|
||||||
pSetupData->LanguageId,
|
pSetupData->LanguageId,
|
||||||
&ErrorLine);
|
&ErrorLine);
|
||||||
}
|
}
|
||||||
|
|
|
@ -516,7 +516,7 @@ LoadSetupInf(
|
||||||
pSetupData->SetupInf =
|
pSetupData->SetupInf =
|
||||||
SpInfOpenInfFile(FileNameBuffer,
|
SpInfOpenInfFile(FileNameBuffer,
|
||||||
NULL,
|
NULL,
|
||||||
/* INF_STYLE_WIN4 | */ INF_STYLE_OLDNT,
|
INF_STYLE_WIN4,
|
||||||
pSetupData->LanguageId,
|
pSetupData->LanguageId,
|
||||||
&ErrorLine);
|
&ErrorLine);
|
||||||
if (pSetupData->SetupInf == INVALID_HANDLE_VALUE)
|
if (pSetupData->SetupInf == INVALID_HANDLE_VALUE)
|
||||||
|
@ -531,7 +531,8 @@ LoadSetupInf(
|
||||||
return ERROR_CORRUPT_TXTSETUPSIF;
|
return ERROR_CORRUPT_TXTSETUPSIF;
|
||||||
|
|
||||||
/* Check 'Signature' string */
|
/* Check 'Signature' string */
|
||||||
if (_wcsicmp(Value, L"$ReactOS$") != 0)
|
if (_wcsicmp(Value, L"$ReactOS$") != 0 &&
|
||||||
|
_wcsicmp(Value, L"$Windows NT$") != 0)
|
||||||
{
|
{
|
||||||
INF_FreeData(Value);
|
INF_FreeData(Value);
|
||||||
return ERROR_SIGNATURE_TXTSETUPSIF;
|
return ERROR_SIGNATURE_TXTSETUPSIF;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include "reactos.h"
|
#include "reactos.h"
|
||||||
|
#include <winnls.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
@ -38,10 +39,10 @@ SetupOpenInfFileExW(
|
||||||
IN LCID LocaleId,
|
IN LCID LocaleId,
|
||||||
OUT PUINT ErrorLine)
|
OUT PUINT ErrorLine)
|
||||||
{
|
{
|
||||||
|
HINF InfHandle;
|
||||||
|
LCID OldLocaleId;
|
||||||
WCHAR Win32FileName[MAX_PATH];
|
WCHAR Win32FileName[MAX_PATH];
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(LocaleId);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SetupOpenInfFileExW is called within setuplib with NT paths, however
|
* SetupOpenInfFileExW is called within setuplib with NT paths, however
|
||||||
* the Win32 SetupOpenInfFileW API only takes Win32 paths. We therefore
|
* the Win32 SetupOpenInfFileW API only takes Win32 paths. We therefore
|
||||||
|
@ -54,10 +55,28 @@ SetupOpenInfFileExW(
|
||||||
return INVALID_HANDLE_VALUE;
|
return INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SetupOpenInfFileW(Win32FileName,
|
/*
|
||||||
InfClass,
|
* Because SetupAPI's SetupOpenInfFileW() function does not allow the user
|
||||||
InfStyle,
|
* to specify a given LCID to use to load localized string substitutions,
|
||||||
ErrorLine);
|
* we temporarily change the current thread locale before calling
|
||||||
|
* SetupOpenInfFileW(). When we have finished we restore the original
|
||||||
|
* thread locale.
|
||||||
|
*/
|
||||||
|
OldLocaleId = GetThreadLocale();
|
||||||
|
if (OldLocaleId != LocaleId)
|
||||||
|
SetThreadLocale(LocaleId);
|
||||||
|
|
||||||
|
/* Load the INF file */
|
||||||
|
InfHandle = SetupOpenInfFileW(Win32FileName,
|
||||||
|
InfClass,
|
||||||
|
InfStyle,
|
||||||
|
ErrorLine);
|
||||||
|
|
||||||
|
/* Restore the original thread locale */
|
||||||
|
if (OldLocaleId != LocaleId)
|
||||||
|
SetThreadLocale(OldLocaleId);
|
||||||
|
|
||||||
|
return InfHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
; Data licensed under MPL 2.0 <https://mozilla.org/MPL/2.0/>
|
; Data licensed under MPL 2.0 <https://mozilla.org/MPL/2.0/>
|
||||||
|
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
; "SSL.com EV Root Certification Authority ECC" (664 bytes)
|
; "SSL.com EV Root Certification Authority ECC" (664 bytes)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
BCD,"BCD00000000\Description\Control","System",0x00010001,1
|
BCD,"BCD00000000\Description\Control","System",0x00010001,1
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature="$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
HKLM,"SOFTWARE\Classes",,0x00000010
|
HKLM,"SOFTWARE\Classes",,0x00000010
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature="$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
; Enable _one_ driver per section by removing the leading semicolon.
|
; Enable _one_ driver per section by removing the leading semicolon.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature="$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[AddReg]
|
[AddReg]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[DelReg]
|
[DelReg]
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
|
|
||||||
.InfBegin
|
.InfBegin
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
;Signature = "$ReactOS$"
|
||||||
|
|
||||||
; Directories relative to the installation directory.
|
; Directories relative to the installation directory.
|
||||||
; For specifying absolute directories, use the SystemPartitionFiles section,
|
; For specifying absolute directories, use the SystemPartitionFiles section,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
|
||||||
[DelReg]
|
[DelReg]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
[Version]
|
[Version]
|
||||||
Signature = "$ReactOS$"
|
Signature = "$Windows NT$"
|
||||||
|
;Signature = "$ReactOS$"
|
||||||
|
|
||||||
;
|
;
|
||||||
; The [SourceDisksNames] section lists all the available installation media
|
; The [SourceDisksNames] section lists all the available installation media
|
||||||
|
|
Loading…
Reference in a new issue