mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[FREELDR] Some changes that accumulated since years in my local copy. Also initialize SetupBlock->ArcSetupDeviceName to some valid value.
This commit is contained in:
parent
c9a20ced91
commit
31a3f3177c
16 changed files with 146 additions and 129 deletions
|
@ -80,5 +80,4 @@ int386_2:
|
|||
pop rbx
|
||||
ret
|
||||
|
||||
|
||||
END
|
||||
|
|
|
@ -21,24 +21,24 @@
|
|||
VOID
|
||||
MachInit(const char *CmdLine)
|
||||
{
|
||||
ULONG PciId;
|
||||
ULONG PciId;
|
||||
|
||||
memset(&MachVtbl, 0, sizeof(MACHVTBL));
|
||||
memset(&MachVtbl, 0, sizeof(MACHVTBL));
|
||||
|
||||
/* Check for Xbox by identifying device at PCI 0:0:0, if it's
|
||||
* 0x10de/0x02a5 then we're running on an Xbox */
|
||||
WRITE_PORT_ULONG((ULONG*) 0xcf8, CONFIG_CMD(0, 0, 0));
|
||||
PciId = READ_PORT_ULONG((ULONG*) 0xcfc);
|
||||
if (0x02a510de == PciId)
|
||||
/* Check for Xbox by identifying device at PCI 0:0:0, if it's
|
||||
* 0x10de/0x02a5 then we're running on an Xbox */
|
||||
WRITE_PORT_ULONG((ULONG*)0xcf8, CONFIG_CMD(0, 0, 0));
|
||||
PciId = READ_PORT_ULONG((ULONG*)0xcfc);
|
||||
if (PciId == 0x02a510de)
|
||||
{
|
||||
XboxMachInit(CmdLine);
|
||||
XboxMachInit(CmdLine);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
PcMachInit(CmdLine);
|
||||
PcMachInit(CmdLine);
|
||||
}
|
||||
|
||||
HalpCalibrateStallExecution();
|
||||
HalpCalibrateStallExecution();
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -27,30 +27,30 @@ DBG_DEFAULT_CHANNEL(HWDETECT);
|
|||
static BOOLEAN
|
||||
FindApmBios(VOID)
|
||||
{
|
||||
REGS RegsIn;
|
||||
REGS RegsOut;
|
||||
REGS RegsIn;
|
||||
REGS RegsOut;
|
||||
|
||||
RegsIn.b.ah = 0x53;
|
||||
RegsIn.b.al = 0x00;
|
||||
RegsIn.w.bx = 0x0000;
|
||||
RegsIn.b.ah = 0x53;
|
||||
RegsIn.b.al = 0x00;
|
||||
RegsIn.w.bx = 0x0000;
|
||||
|
||||
Int386(0x15, &RegsIn, &RegsOut);
|
||||
Int386(0x15, &RegsIn, &RegsOut);
|
||||
|
||||
if (INT386_SUCCESS(RegsOut))
|
||||
if (INT386_SUCCESS(RegsOut))
|
||||
{
|
||||
TRACE("Found APM BIOS\n");
|
||||
TRACE("AH: %x\n", RegsOut.b.ah);
|
||||
TRACE("AL: %x\n", RegsOut.b.al);
|
||||
TRACE("BH: %x\n", RegsOut.b.bh);
|
||||
TRACE("BL: %x\n", RegsOut.b.bl);
|
||||
TRACE("CX: %x\n", RegsOut.w.cx);
|
||||
TRACE("Found APM BIOS\n");
|
||||
TRACE("AH: %x\n", RegsOut.b.ah);
|
||||
TRACE("AL: %x\n", RegsOut.b.al);
|
||||
TRACE("BH: %x\n", RegsOut.b.bh);
|
||||
TRACE("BL: %x\n", RegsOut.b.bl);
|
||||
TRACE("CX: %x\n", RegsOut.w.cx);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
TRACE("No APM BIOS found\n");
|
||||
TRACE("No APM BIOS found\n");
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ FindPciBios(PPCI_REGISTRY_INFO BusData)
|
|||
Int386(0x1A, &RegsIn, &RegsOut);
|
||||
|
||||
if (INT386_SUCCESS(RegsOut) &&
|
||||
(RegsOut.d.edx == 0x20494350) &&
|
||||
(RegsOut.d.edx == ' ICP') &&
|
||||
(RegsOut.b.ah == 0))
|
||||
{
|
||||
TRACE("Found PCI bios\n");
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
#include "prep.h"
|
||||
#include "compat.h"
|
||||
|
||||
extern void BootMain( LPSTR CmdLine );
|
||||
extern void BootMain( PSTR CmdLine );
|
||||
extern const PCSTR GetFreeLoaderVersionString(VOID);
|
||||
extern ULONG CacheSizeLimit;
|
||||
of_proxy ofproxy;
|
||||
|
|
|
@ -432,10 +432,10 @@ FrLdrMapModule(FILE *KernelImage, PCHAR ImageName, PCHAR MemLoadAddr, ULONG Kern
|
|||
Elf32_Ehdr ehdr;
|
||||
Elf32_Shdr *shdr;
|
||||
LARGE_INTEGER Position;
|
||||
LPSTR TempName;
|
||||
PSTR TempName;
|
||||
|
||||
TempName = strrchr(ImageName, '\\');
|
||||
if(TempName) TempName++; else TempName = (LPSTR)ImageName;
|
||||
if(TempName) TempName++; else TempName = (PSTR)ImageName;
|
||||
ModuleData = LdrGetModuleObject(TempName);
|
||||
|
||||
if(ModuleData)
|
||||
|
@ -708,7 +708,7 @@ FrLdrMapKernel(FILE *KernelImage)
|
|||
ULONG_PTR
|
||||
NTAPI
|
||||
FrLdrLoadModule(FILE *ModuleImage,
|
||||
LPCSTR ModuleName,
|
||||
PCSTR ModuleName,
|
||||
PULONG ModuleSize)
|
||||
{
|
||||
ARC_STATUS Status;
|
||||
|
@ -716,8 +716,8 @@ FrLdrLoadModule(FILE *ModuleImage,
|
|||
ULONG LocalModuleSize;
|
||||
ULONG_PTR ThisModuleBase = NextModuleBase;
|
||||
PLOADER_MODULE ModuleData;
|
||||
LPSTR NameBuffer;
|
||||
LPSTR TempName;
|
||||
PSTR NameBuffer;
|
||||
PSTR TempName;
|
||||
|
||||
/* Get current module data structure and module name string array */
|
||||
ModuleData = &reactos_modules[LoaderBlock.ModsCount];
|
||||
|
@ -795,10 +795,10 @@ FrLdrMapImage(IN FILE *Image, IN PCHAR ShortName, IN ULONG ImageType)
|
|||
|
||||
ULONG_PTR
|
||||
NTAPI
|
||||
FrLdrCreateModule(LPCSTR ModuleName)
|
||||
FrLdrCreateModule(PCSTR ModuleName)
|
||||
{
|
||||
PLOADER_MODULE ModuleData;
|
||||
LPSTR NameBuffer;
|
||||
PSTR NameBuffer;
|
||||
|
||||
/* Get current module data structure and module name string array */
|
||||
ModuleData = &reactos_modules[LoaderBlock.ModsCount];
|
||||
|
|
|
@ -83,6 +83,3 @@ Int386_vector_opcode:
|
|||
pop ds
|
||||
|
||||
ret
|
||||
|
||||
|
||||
|
||||
|
|
7
boot/freeldr/freeldr/cache/cache.c
vendored
7
boot/freeldr/freeldr/cache/cache.c
vendored
|
@ -91,12 +91,9 @@ BOOLEAN CacheInitializeDrive(UCHAR DriveNumber)
|
|||
CacheManagerDrive.BlockSize = MachDiskGetCacheableBlockCount(DriveNumber);
|
||||
|
||||
CacheBlockCount = 0;
|
||||
CacheSizeLimit = TotalPagesInLookupTable / 8 * MM_PAGE_SIZE;
|
||||
CacheSizeCurrent = 0;
|
||||
if (CacheSizeLimit > TEMP_HEAP_SIZE - (128 * 1024))
|
||||
{
|
||||
CacheSizeLimit = TEMP_HEAP_SIZE - (128 * 1024);
|
||||
}
|
||||
CacheSizeLimit = TotalPagesInLookupTable / 8 * MM_PAGE_SIZE;
|
||||
CacheSizeLimit = min(CacheSizeLimit, TEMP_HEAP_SIZE - (128 * 1024));
|
||||
|
||||
CacheManagerInitialized = TRUE;
|
||||
|
||||
|
|
|
@ -165,8 +165,8 @@ WinLdrMapSpecialPages(ULONG PcrBasePage)
|
|||
VOID
|
||||
WinLdrSetupForNt(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN PVOID *GdtIdt,
|
||||
IN ULONG *PcrBasePage,
|
||||
IN ULONG *TssBasePage)
|
||||
IN PULONG PcrBasePage,
|
||||
IN PULONG TssBasePage)
|
||||
{
|
||||
PKPDR_PAGE PdrPage = (PVOID)0xFFD00000;
|
||||
|
||||
|
|
|
@ -632,7 +632,7 @@ WinLdrSetProcessorContext(void)
|
|||
VOID
|
||||
MempDump(VOID)
|
||||
{
|
||||
ULONG *PDE_Addr=(ULONG *)PDE;//0xC0300000;
|
||||
PULONG PDE_Addr=(PULONG)PDE;//0xC0300000;
|
||||
int i, j;
|
||||
|
||||
TRACE("\nPDE\n");
|
||||
|
|
|
@ -225,7 +225,7 @@ RegEnumKey(
|
|||
_In_ HKEY Key,
|
||||
_In_ ULONG Index,
|
||||
_Out_ PWCHAR Name,
|
||||
_Inout_ ULONG* NameSize,
|
||||
_Inout_ PULONG NameSize,
|
||||
_Out_opt_ PHKEY SubKey)
|
||||
{
|
||||
PHHIVE Hive = &CmHive->Hive;
|
||||
|
@ -398,9 +398,9 @@ VOID
|
|||
RepGetValueData(
|
||||
_In_ PHHIVE Hive,
|
||||
_In_ PCM_KEY_VALUE ValueCell,
|
||||
_Out_opt_ ULONG* Type,
|
||||
_Out_opt_ PULONG Type,
|
||||
_Out_opt_ PUCHAR Data,
|
||||
_Inout_opt_ ULONG* DataSize)
|
||||
_Inout_opt_ PULONG DataSize)
|
||||
{
|
||||
ULONG DataLength;
|
||||
PVOID DataCell;
|
||||
|
@ -435,9 +435,9 @@ LONG
|
|||
RegQueryValue(
|
||||
_In_ HKEY Key,
|
||||
_In_z_ PCWSTR ValueName,
|
||||
_Out_opt_ ULONG* Type,
|
||||
_Out_opt_ PULONG Type,
|
||||
_Out_opt_ PUCHAR Data,
|
||||
_Inout_opt_ ULONG* DataSize)
|
||||
_Inout_opt_ PULONG DataSize)
|
||||
{
|
||||
PHHIVE Hive = &CmHive->Hive;
|
||||
PCM_KEY_NODE KeyNode;
|
||||
|
@ -485,10 +485,10 @@ RegEnumValue(
|
|||
_In_ HKEY Key,
|
||||
_In_ ULONG Index,
|
||||
_Out_ PWCHAR ValueName,
|
||||
_Inout_ ULONG* NameSize,
|
||||
_Out_opt_ ULONG* Type,
|
||||
_Inout_ PULONG NameSize,
|
||||
_Out_opt_ PULONG Type,
|
||||
_Out_opt_ PUCHAR Data,
|
||||
_Inout_opt_ ULONG* DataSize)
|
||||
_Inout_opt_ PULONG DataSize)
|
||||
{
|
||||
PHHIVE Hive = &CmHive->Hive;
|
||||
PCM_KEY_NODE KeyNode;
|
||||
|
|
|
@ -23,41 +23,48 @@
|
|||
|
||||
typedef HANDLE HKEY, *PHKEY;
|
||||
|
||||
BOOLEAN
|
||||
RegImportBinaryHive(
|
||||
_In_ PVOID ChunkBase,
|
||||
_In_ ULONG ChunkSize);
|
||||
|
||||
LONG
|
||||
RegInitCurrentControlSet(BOOLEAN LastKnownGood);
|
||||
RegInitCurrentControlSet(
|
||||
_In_ BOOLEAN LastKnownGood);
|
||||
|
||||
LONG
|
||||
RegEnumKey(
|
||||
_In_ HKEY Key,
|
||||
_In_ ULONG Index,
|
||||
_Out_ PWCHAR Name,
|
||||
_Inout_ ULONG* NameSize,
|
||||
_Inout_ PULONG NameSize,
|
||||
_Out_opt_ PHKEY SubKey);
|
||||
|
||||
LONG
|
||||
RegOpenKey(HKEY ParentKey,
|
||||
PCWSTR KeyName,
|
||||
PHKEY Key);
|
||||
RegOpenKey(
|
||||
_In_ HKEY ParentKey,
|
||||
_In_z_ PCWSTR KeyName,
|
||||
_Out_ PHKEY Key);
|
||||
|
||||
LONG
|
||||
RegQueryValue(HKEY Key,
|
||||
PCWSTR ValueName,
|
||||
ULONG* Type,
|
||||
PUCHAR Data,
|
||||
ULONG* DataSize);
|
||||
RegQueryValue(
|
||||
_In_ HKEY Key,
|
||||
_In_z_ PCWSTR ValueName,
|
||||
_Out_opt_ PULONG Type,
|
||||
_Out_opt_ PUCHAR Data,
|
||||
_Inout_opt_ PULONG DataSize);
|
||||
|
||||
#if 0
|
||||
LONG
|
||||
RegEnumValue(HKEY Key,
|
||||
ULONG Index,
|
||||
PWCHAR ValueName,
|
||||
ULONG* NameSize,
|
||||
ULONG* Type,
|
||||
PUCHAR Data,
|
||||
ULONG* DataSize);
|
||||
|
||||
BOOLEAN
|
||||
RegImportBinaryHive(PVOID ChunkBase,
|
||||
ULONG ChunkSize);
|
||||
RegEnumValue(
|
||||
_In_ HKEY Key,
|
||||
_In_ ULONG Index,
|
||||
_Out_ PWCHAR ValueName,
|
||||
_Inout_ PULONG NameSize,
|
||||
_Out_opt_ PULONG Type,
|
||||
_Out_opt_ PUCHAR Data,
|
||||
_Inout_opt_ PULONG DataSize)
|
||||
#endif
|
||||
|
||||
#endif /* __REGISTRY_H */
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ DBG_DEFAULT_CHANNEL(WINDOWS);
|
|||
VOID AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK *OutLoaderBlock);
|
||||
|
||||
static VOID
|
||||
SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR SearchPath)
|
||||
SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, PCSTR SearchPath)
|
||||
{
|
||||
INFCONTEXT InfContext;
|
||||
LPCSTR AnsiName, OemName, LangName;
|
||||
PCSTR AnsiName, OemName, LangName;
|
||||
|
||||
/* Get ANSI codepage file */
|
||||
if (!InfFindFirstLine(InfHandle, "NLS", "AnsiCodepage", &InfContext))
|
||||
|
@ -79,7 +79,7 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
|
|||
{
|
||||
BOOLEAN Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
||||
TRACE("NLS data loading %s\n", Success ? "successful" : "failed");
|
||||
}
|
||||
}
|
||||
#else
|
||||
WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
||||
#endif
|
||||
|
@ -89,11 +89,11 @@ SetupLdrLoadNlsData(PLOADER_PARAMETER_BLOCK LoaderBlock, HINF InfHandle, LPCSTR
|
|||
}
|
||||
|
||||
static VOID
|
||||
SetupLdrScanBootDrivers(PLIST_ENTRY BootDriverListHead, HINF InfHandle, LPCSTR SearchPath)
|
||||
SetupLdrScanBootDrivers(PLIST_ENTRY BootDriverListHead, HINF InfHandle, PCSTR SearchPath)
|
||||
{
|
||||
INFCONTEXT InfContext, dirContext;
|
||||
BOOLEAN Success;
|
||||
LPCSTR Media, DriverName, dirIndex, ImagePath;
|
||||
PCSTR Media, DriverName, dirIndex, ImagePath;
|
||||
WCHAR ServiceName[256];
|
||||
WCHAR ImagePathW[256];
|
||||
|
||||
|
@ -152,8 +152,8 @@ LoadReactOSSetup(
|
|||
CHAR FileName[512];
|
||||
CHAR BootPath[512];
|
||||
CHAR BootOptions2[256];
|
||||
LPCSTR LoadOptions;
|
||||
LPSTR BootOptions;
|
||||
PCSTR LoadOptions;
|
||||
PSTR BootOptions;
|
||||
BOOLEAN BootFromFloppy;
|
||||
BOOLEAN Success;
|
||||
ULONG i, ErrorLine;
|
||||
|
@ -161,9 +161,9 @@ LoadReactOSSetup(
|
|||
INFCONTEXT InfContext;
|
||||
PLOADER_PARAMETER_BLOCK LoaderBlock;
|
||||
PSETUP_LOADER_BLOCK SetupBlock;
|
||||
LPCSTR SystemPath;
|
||||
PCSTR SystemPath;
|
||||
|
||||
static LPCSTR SourcePaths[] =
|
||||
static PCSTR SourcePaths[] =
|
||||
{
|
||||
"", /* Only for floppy boot */
|
||||
#if defined(_M_IX86)
|
||||
|
@ -297,7 +297,7 @@ LoadReactOSSetup(
|
|||
/* Get debug load options and use them */
|
||||
if (InfFindFirstLine(InfHandle, "SetupData", "DbgOsLoadOptions", &InfContext))
|
||||
{
|
||||
LPCSTR DbgLoadOptions;
|
||||
PCSTR DbgLoadOptions;
|
||||
|
||||
if (InfGetDataField(&InfContext, 1, &DbgLoadOptions))
|
||||
LoadOptions = DbgLoadOptions;
|
||||
|
|
|
@ -75,9 +75,9 @@ AllocateAndInitLPB(PLOADER_PARAMETER_BLOCK *OutLoaderBlock)
|
|||
// Init "phase 1"
|
||||
VOID
|
||||
WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
LPCSTR Options,
|
||||
LPCSTR SystemRoot,
|
||||
LPCSTR BootPath,
|
||||
PCSTR Options,
|
||||
PCSTR SystemRoot,
|
||||
PCSTR BootPath,
|
||||
USHORT VersionToBoot)
|
||||
{
|
||||
/* Examples of correct options and paths */
|
||||
|
@ -86,7 +86,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
//CHAR SystemRoot[] = "\\WINNT\\";
|
||||
//CHAR ArcBoot[] = "multi(0)disk(0)rdisk(0)partition(1)";
|
||||
|
||||
LPSTR LoadOptions, NewLoadOptions;
|
||||
PSTR LoadOptions, NewLoadOptions;
|
||||
CHAR HalPath[] = "\\";
|
||||
CHAR ArcBoot[MAX_PATH+1];
|
||||
CHAR MiscFiles[MAX_PATH+1];
|
||||
|
@ -107,6 +107,23 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
RtlStringCbCopyA(LoaderBlock->ArcBootDeviceName, sizeof(WinLdrSystemBlock->ArcBootDeviceName), ArcBoot);
|
||||
LoaderBlock->ArcBootDeviceName = PaToVa(LoaderBlock->ArcBootDeviceName);
|
||||
|
||||
//
|
||||
// IMPROVE!!
|
||||
// SetupBlock->ArcSetupDeviceName must be the path to the setup **SOURCE**,
|
||||
// and not the setup boot path. Indeed they may differ!!
|
||||
//
|
||||
/* If we have a setup block, adjust also its ARC path */
|
||||
if (LoaderBlock->SetupLdrBlock)
|
||||
{
|
||||
PSETUP_LOADER_BLOCK SetupBlock = LoaderBlock->SetupLdrBlock;
|
||||
|
||||
/* Matches ArcBoot path */
|
||||
SetupBlock->ArcSetupDeviceName = WinLdrSystemBlock->ArcBootDeviceName;
|
||||
SetupBlock->ArcSetupDeviceName = PaToVa(SetupBlock->ArcSetupDeviceName);
|
||||
|
||||
/* Note: LoaderBlock->SetupLdrBlock is PaToVa'ed at the end of this function */
|
||||
}
|
||||
|
||||
/* Fill ARC HalDevice, it matches ArcBoot path */
|
||||
LoaderBlock->ArcHalDeviceName = WinLdrSystemBlock->ArcBootDeviceName;
|
||||
LoaderBlock->ArcHalDeviceName = PaToVa(LoaderBlock->ArcHalDeviceName);
|
||||
|
@ -221,7 +238,7 @@ WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
|
||||
static BOOLEAN
|
||||
WinLdrLoadDeviceDriver(PLIST_ENTRY LoadOrderListHead,
|
||||
LPCSTR BootPath,
|
||||
PCSTR BootPath,
|
||||
PUNICODE_STRING FilePath,
|
||||
ULONG Flags,
|
||||
PLDR_DATA_TABLE_ENTRY *DriverDTE)
|
||||
|
@ -292,7 +309,7 @@ WinLdrLoadDeviceDriver(PLIST_ENTRY LoadOrderListHead,
|
|||
|
||||
BOOLEAN
|
||||
WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
LPCSTR BootPath)
|
||||
PCSTR BootPath)
|
||||
{
|
||||
PLIST_ENTRY NextBd;
|
||||
PBOOT_DRIVER_LIST_ENTRY BootDriver;
|
||||
|
@ -344,7 +361,7 @@ WinLdrLoadBootDrivers(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
|
||||
PVOID
|
||||
WinLdrLoadModule(PCSTR ModuleName,
|
||||
ULONG *Size,
|
||||
PULONG Size,
|
||||
TYPE_OF_MEMORY MemoryType)
|
||||
{
|
||||
ULONG FileId;
|
||||
|
@ -782,15 +799,15 @@ ARC_STATUS
|
|||
LoadAndBootWindowsCommon(
|
||||
USHORT OperatingSystemVersion,
|
||||
PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
LPCSTR BootOptions,
|
||||
LPCSTR BootPath,
|
||||
PCSTR BootOptions,
|
||||
PCSTR BootPath,
|
||||
BOOLEAN Setup)
|
||||
{
|
||||
PLOADER_PARAMETER_BLOCK LoaderBlockVA;
|
||||
BOOLEAN Success;
|
||||
PLDR_DATA_TABLE_ENTRY KernelDTE;
|
||||
KERNEL_ENTRY_POINT KiSystemStartup;
|
||||
LPCSTR SystemRoot;
|
||||
PCSTR SystemRoot;
|
||||
|
||||
TRACE("LoadAndBootWindowsCommon()\n");
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ VOID ConvertConfigToVA(PCONFIGURATION_COMPONENT_DATA Start);
|
|||
|
||||
|
||||
// winldr.c
|
||||
PVOID WinLdrLoadModule(PCSTR ModuleName, ULONG *Size,
|
||||
PVOID WinLdrLoadModule(PCSTR ModuleName, PULONG Size,
|
||||
TYPE_OF_MEMORY MemoryType);
|
||||
|
||||
// wlmemory.c
|
||||
|
@ -112,21 +112,21 @@ WinLdrInitSystemHive(
|
|||
IN BOOLEAN Setup);
|
||||
|
||||
BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN LPCSTR DirectoryPath);
|
||||
IN PCSTR DirectoryPath);
|
||||
|
||||
// winldr.c
|
||||
VOID
|
||||
WinLdrInitializePhase1(PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
LPCSTR Options,
|
||||
LPCSTR SystemPath,
|
||||
LPCSTR BootPath,
|
||||
PCSTR Options,
|
||||
PCSTR SystemPath,
|
||||
PCSTR BootPath,
|
||||
USHORT VersionToBoot);
|
||||
BOOLEAN
|
||||
WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN LPCSTR DirectoryPath,
|
||||
IN LPCSTR AnsiFileName,
|
||||
IN LPCSTR OemFileName,
|
||||
IN LPCSTR LanguageFileName);
|
||||
IN PCSTR DirectoryPath,
|
||||
IN PCSTR AnsiFileName,
|
||||
IN PCSTR OemFileName,
|
||||
IN PCSTR LanguageFileName);
|
||||
BOOLEAN
|
||||
WinLdrAddDriverToList(LIST_ENTRY *BootDriverListHead,
|
||||
LPWSTR RegistryPath,
|
||||
|
@ -146,6 +146,6 @@ ARC_STATUS
|
|||
LoadAndBootWindowsCommon(
|
||||
USHORT OperatingSystemVersion,
|
||||
PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
LPCSTR BootOptions,
|
||||
LPCSTR BootPath,
|
||||
PCSTR BootOptions,
|
||||
PCSTR BootPath,
|
||||
BOOLEAN Setup);
|
||||
|
|
|
@ -19,13 +19,13 @@ DBG_DEFAULT_CHANNEL(WINDOWS);
|
|||
ULONG TotalNLSSize = 0;
|
||||
|
||||
static BOOLEAN
|
||||
WinLdrGetNLSNames(LPSTR AnsiName,
|
||||
LPSTR OemName,
|
||||
LPSTR LangName);
|
||||
WinLdrGetNLSNames(PSTR AnsiName,
|
||||
PSTR OemName,
|
||||
PSTR LangName);
|
||||
|
||||
static VOID
|
||||
WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead,
|
||||
IN LPCSTR DirectoryPath);
|
||||
IN PCSTR SystemRoot);
|
||||
|
||||
|
||||
/* FUNCTIONS **************************************************************/
|
||||
|
@ -171,14 +171,14 @@ WinLdrInitSystemHive(
|
|||
}
|
||||
|
||||
BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN LPCSTR DirectoryPath)
|
||||
IN PCSTR SystemRoot)
|
||||
{
|
||||
CHAR SearchPath[1024];
|
||||
CHAR AnsiName[256], OemName[256], LangName[256];
|
||||
BOOLEAN Success;
|
||||
|
||||
/* Scan registry and prepare boot drivers list */
|
||||
WinLdrScanRegistry(&LoaderBlock->BootDriverListHead, DirectoryPath);
|
||||
WinLdrScanRegistry(&LoaderBlock->BootDriverListHead, SystemRoot);
|
||||
|
||||
/* Get names of NLS files */
|
||||
Success = WinLdrGetNLSNames(AnsiName, OemName, LangName);
|
||||
|
@ -191,7 +191,7 @@ BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
TRACE("NLS data %s %s %s\n", AnsiName, OemName, LangName);
|
||||
|
||||
/* Load NLS data */
|
||||
strcpy(SearchPath, DirectoryPath);
|
||||
strcpy(SearchPath, SystemRoot);
|
||||
strcat(SearchPath, "system32\\");
|
||||
Success = WinLdrLoadNLSData(LoaderBlock, SearchPath, AnsiName, OemName, LangName);
|
||||
TRACE("NLS data loading %s\n", Success ? "successful" : "failed");
|
||||
|
@ -208,9 +208,9 @@ BOOLEAN WinLdrScanSystemHive(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
|||
|
||||
// Queries registry for those three file names
|
||||
static BOOLEAN
|
||||
WinLdrGetNLSNames(LPSTR AnsiName,
|
||||
LPSTR OemName,
|
||||
LPSTR LangName)
|
||||
WinLdrGetNLSNames(PSTR AnsiName,
|
||||
PSTR OemName,
|
||||
PSTR LangName)
|
||||
{
|
||||
LONG rc = ERROR_SUCCESS;
|
||||
HKEY hKey;
|
||||
|
@ -218,7 +218,7 @@ WinLdrGetNLSNames(LPSTR AnsiName,
|
|||
WCHAR NameBuffer[80];
|
||||
ULONG BufferSize;
|
||||
|
||||
/* open the codepage key */
|
||||
/* Open the CodePage key */
|
||||
rc = RegOpenKey(NULL,
|
||||
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage",
|
||||
&hKey);
|
||||
|
@ -266,7 +266,7 @@ WinLdrGetNLSNames(LPSTR AnsiName,
|
|||
}
|
||||
sprintf(OemName, "%S", NameBuffer);
|
||||
|
||||
/* Open the language key */
|
||||
/* Open the Language key */
|
||||
rc = RegOpenKey(NULL,
|
||||
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language",
|
||||
&hKey);
|
||||
|
@ -299,10 +299,10 @@ WinLdrGetNLSNames(LPSTR AnsiName,
|
|||
|
||||
BOOLEAN
|
||||
WinLdrLoadNLSData(IN OUT PLOADER_PARAMETER_BLOCK LoaderBlock,
|
||||
IN LPCSTR DirectoryPath,
|
||||
IN LPCSTR AnsiFileName,
|
||||
IN LPCSTR OemFileName,
|
||||
IN LPCSTR LanguageFileName)
|
||||
IN PCSTR DirectoryPath,
|
||||
IN PCSTR AnsiFileName,
|
||||
IN PCSTR OemFileName,
|
||||
IN PCSTR LanguageFileName)
|
||||
{
|
||||
CHAR FileName[255];
|
||||
ULONG AnsiFileId;
|
||||
|
@ -486,7 +486,7 @@ Failure:
|
|||
|
||||
static VOID
|
||||
WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead,
|
||||
IN LPCSTR DirectoryPath)
|
||||
IN PCSTR SystemRoot)
|
||||
{
|
||||
LONG rc = 0;
|
||||
HKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
|
||||
|
@ -614,11 +614,11 @@ WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead,
|
|||
{
|
||||
TRACE_CH(REACTOS, "ImagePath: not found\n");
|
||||
TempImagePath[0] = 0;
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s\\system32\\drivers\\%S.sys", DirectoryPath, ServiceName);
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s\\system32\\drivers\\%S.sys", SystemRoot, ServiceName);
|
||||
}
|
||||
else if (TempImagePath[0] != L'\\')
|
||||
{
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", DirectoryPath, TempImagePath);
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", SystemRoot, TempImagePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -694,11 +694,11 @@ WinLdrScanRegistry(IN OUT PLIST_ENTRY BootDriverListHead,
|
|||
{
|
||||
TRACE_CH(REACTOS, "ImagePath: not found\n");
|
||||
TempImagePath[0] = 0;
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%ssystem32\\drivers\\%S.sys", DirectoryPath, ServiceName);
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%ssystem32\\drivers\\%S.sys", SystemRoot, ServiceName);
|
||||
}
|
||||
else if (TempImagePath[0] != L'\\')
|
||||
{
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", DirectoryPath, TempImagePath);
|
||||
RtlStringCbPrintfA(ImagePath, sizeof(ImagePath), "%s%S", SystemRoot, TempImagePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue