mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 16:40:27 +00:00
[FREELDR] Minor code formatting / renaming some variables.
This commit is contained in:
parent
04b4e3b05d
commit
3033580c1a
2 changed files with 39 additions and 39 deletions
|
@ -183,20 +183,20 @@ LoadReactOSSetup(
|
||||||
ARC_STATUS Status;
|
ARC_STATUS Status;
|
||||||
PCSTR ArgValue;
|
PCSTR ArgValue;
|
||||||
PCSTR SystemPartition;
|
PCSTR SystemPartition;
|
||||||
PCHAR File;
|
PCSTR SystemPath;
|
||||||
CHAR FileName[MAX_PATH];
|
PSTR FileName;
|
||||||
CHAR BootPath[MAX_PATH];
|
|
||||||
CHAR BootOptions2[256];
|
|
||||||
PCSTR LoadOptions;
|
|
||||||
PSTR BootOptions;
|
|
||||||
BOOLEAN BootFromFloppy;
|
BOOLEAN BootFromFloppy;
|
||||||
BOOLEAN Success;
|
BOOLEAN Success;
|
||||||
ULONG i, ErrorLine;
|
|
||||||
HINF InfHandle;
|
HINF InfHandle;
|
||||||
INFCONTEXT InfContext;
|
INFCONTEXT InfContext;
|
||||||
|
ULONG i, ErrorLine;
|
||||||
PLOADER_PARAMETER_BLOCK LoaderBlock;
|
PLOADER_PARAMETER_BLOCK LoaderBlock;
|
||||||
PSETUP_LOADER_BLOCK SetupBlock;
|
PSETUP_LOADER_BLOCK SetupBlock;
|
||||||
PCSTR SystemPath;
|
CHAR BootPath[MAX_PATH];
|
||||||
|
CHAR FilePath[MAX_PATH];
|
||||||
|
CHAR BootOptions2[256];
|
||||||
|
PSTR BootOptions;
|
||||||
|
PCSTR LoadOptions;
|
||||||
|
|
||||||
static PCSTR SourcePaths[] =
|
static PCSTR SourcePaths[] =
|
||||||
{
|
{
|
||||||
|
@ -253,17 +253,17 @@ LoadReactOSSetup(
|
||||||
if (strrchr(BootPath, ')') == NULL)
|
if (strrchr(BootPath, ')') == NULL)
|
||||||
{
|
{
|
||||||
/* Temporarily save the boot path */
|
/* Temporarily save the boot path */
|
||||||
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
|
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
|
||||||
|
|
||||||
/* This is not a full path: prepend the SystemPartition */
|
/* This is not a full path: prepend the SystemPartition */
|
||||||
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
|
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
|
||||||
|
|
||||||
/* Append a path separator if needed */
|
/* Append a path separator if needed */
|
||||||
if (*FileName != '\\' && *FileName != '/')
|
if (*FilePath != '\\' && *FilePath != '/')
|
||||||
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
|
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
|
||||||
|
|
||||||
/* Append the remaining path */
|
/* Append the remaining path */
|
||||||
RtlStringCbCatA(BootPath, sizeof(BootPath), FileName);
|
RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Append a path separator if needed */
|
/* Append a path separator if needed */
|
||||||
|
@ -280,17 +280,17 @@ LoadReactOSSetup(
|
||||||
|
|
||||||
TRACE("BootOptions: '%s'\n", BootOptions2);
|
TRACE("BootOptions: '%s'\n", BootOptions2);
|
||||||
|
|
||||||
/* Check if a ramdisk file was given */
|
/* Check if a RAM disk file was given */
|
||||||
File = strstr(BootOptions2, "/RDPATH=");
|
FileName = strstr(BootOptions2, "/RDPATH=");
|
||||||
if (File)
|
if (FileName)
|
||||||
{
|
{
|
||||||
/* Load the ramdisk */
|
/* Load the RAM disk */
|
||||||
Status = RamDiskInitialize(FALSE, BootOptions2, SystemPartition);
|
Status = RamDiskInitialize(FALSE, BootOptions2, SystemPartition);
|
||||||
if (Status != ESUCCESS)
|
if (Status != ESUCCESS)
|
||||||
{
|
{
|
||||||
File += 8;
|
FileName += 8;
|
||||||
UiMessageBox("Failed to load RAM disk file '%.*s'",
|
UiMessageBox("Failed to load RAM disk file '%.*s'",
|
||||||
strcspn(File, " \t"), File);
|
strcspn(FileName, " \t"), FileName);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -298,8 +298,8 @@ LoadReactOSSetup(
|
||||||
/* Check if we booted from floppy */
|
/* Check if we booted from floppy */
|
||||||
BootFromFloppy = strstr(BootPath, "fdisk") != NULL;
|
BootFromFloppy = strstr(BootPath, "fdisk") != NULL;
|
||||||
|
|
||||||
/* Open 'txtsetup.sif' from any of source paths */
|
/* Open 'txtsetup.sif' from any of the source paths */
|
||||||
File = BootPath + strlen(BootPath);
|
FileName = BootPath + strlen(BootPath);
|
||||||
for (i = BootFromFloppy ? 0 : 1; ; i++)
|
for (i = BootFromFloppy ? 0 : 1; ; i++)
|
||||||
{
|
{
|
||||||
SystemPath = SourcePaths[i];
|
SystemPath = SourcePaths[i];
|
||||||
|
@ -308,10 +308,10 @@ LoadReactOSSetup(
|
||||||
UiMessageBox("Failed to open txtsetup.sif");
|
UiMessageBox("Failed to open txtsetup.sif");
|
||||||
return ENOENT;
|
return ENOENT;
|
||||||
}
|
}
|
||||||
RtlStringCbCopyA(File, sizeof(BootPath) - (File - BootPath)*sizeof(CHAR), SystemPath);
|
RtlStringCbCopyA(FileName, sizeof(BootPath) - (FileName - BootPath)*sizeof(CHAR), SystemPath);
|
||||||
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
|
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
|
||||||
RtlStringCbCatA(FileName, sizeof(FileName), "txtsetup.sif");
|
RtlStringCbCatA(FilePath, sizeof(FilePath), "txtsetup.sif");
|
||||||
if (InfOpenFile(&InfHandle, FileName, &ErrorLine))
|
if (InfOpenFile(&InfHandle, FilePath, &ErrorLine))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -353,14 +353,14 @@ LoadReactOSSetup(
|
||||||
/* Allocate and minimally-initialize the Loader Parameter Block */
|
/* Allocate and minimally-initialize the Loader Parameter Block */
|
||||||
AllocateAndInitLPB(_WIN32_WINNT_WS03, &LoaderBlock);
|
AllocateAndInitLPB(_WIN32_WINNT_WS03, &LoaderBlock);
|
||||||
|
|
||||||
/* Allocate and initialize setup loader block */
|
/* Allocate and initialize the setup loader block */
|
||||||
SetupBlock = &WinLdrSystemBlock->SetupBlock;
|
SetupBlock = &WinLdrSystemBlock->SetupBlock;
|
||||||
LoaderBlock->SetupLdrBlock = SetupBlock;
|
LoaderBlock->SetupLdrBlock = SetupBlock;
|
||||||
|
|
||||||
/* Set textmode setup flag */
|
/* Set textmode setup flag */
|
||||||
SetupBlock->Flags = SETUPLDR_TEXT_MODE;
|
SetupBlock->Flags = SETUPLDR_TEXT_MODE;
|
||||||
|
|
||||||
/* Load the system hive "setupreg.hiv" for setup */
|
/* Load the "setupreg.hiv" setup system hive */
|
||||||
UiDrawBackdrop();
|
UiDrawBackdrop();
|
||||||
UiDrawProgressBarCenter(15, 100, "Loading setup system hive...");
|
UiDrawProgressBarCenter(15, 100, "Loading setup system hive...");
|
||||||
Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE);
|
Success = WinLdrInitSystemHive(LoaderBlock, BootPath, TRUE);
|
||||||
|
@ -370,9 +370,9 @@ LoadReactOSSetup(
|
||||||
return ENOEXEC;
|
return ENOEXEC;
|
||||||
|
|
||||||
/* Load NLS data, they are in the System32 directory of the installation medium */
|
/* Load NLS data, they are in the System32 directory of the installation medium */
|
||||||
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
|
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
|
||||||
RtlStringCbCatA(FileName, sizeof(FileName), "system32\\");
|
RtlStringCbCatA(FilePath, sizeof(FilePath), "system32\\");
|
||||||
SetupLdrLoadNlsData(LoaderBlock, InfHandle, FileName);
|
SetupLdrLoadNlsData(LoaderBlock, InfHandle, FilePath);
|
||||||
|
|
||||||
/* Load the Firmware Errata file from the installation medium */
|
/* Load the Firmware Errata file from the installation medium */
|
||||||
Success = SetupLdrInitErrataInf(LoaderBlock, InfHandle, BootPath);
|
Success = SetupLdrInitErrataInf(LoaderBlock, InfHandle, BootPath);
|
||||||
|
|
|
@ -825,12 +825,12 @@ LoadAndBootWindows(
|
||||||
ARC_STATUS Status;
|
ARC_STATUS Status;
|
||||||
PCSTR ArgValue;
|
PCSTR ArgValue;
|
||||||
PCSTR SystemPartition;
|
PCSTR SystemPartition;
|
||||||
PCHAR File;
|
PCSTR FileName;
|
||||||
BOOLEAN Success;
|
BOOLEAN Success;
|
||||||
USHORT OperatingSystemVersion;
|
USHORT OperatingSystemVersion;
|
||||||
PLOADER_PARAMETER_BLOCK LoaderBlock;
|
PLOADER_PARAMETER_BLOCK LoaderBlock;
|
||||||
CHAR BootPath[MAX_PATH];
|
CHAR BootPath[MAX_PATH];
|
||||||
CHAR FileName[MAX_PATH];
|
CHAR FilePath[MAX_PATH];
|
||||||
CHAR BootOptions[256];
|
CHAR BootOptions[256];
|
||||||
|
|
||||||
/* Retrieve the (mandatory) boot type */
|
/* Retrieve the (mandatory) boot type */
|
||||||
|
@ -883,17 +883,17 @@ LoadAndBootWindows(
|
||||||
if (strrchr(BootPath, ')') == NULL)
|
if (strrchr(BootPath, ')') == NULL)
|
||||||
{
|
{
|
||||||
/* Temporarily save the boot path */
|
/* Temporarily save the boot path */
|
||||||
RtlStringCbCopyA(FileName, sizeof(FileName), BootPath);
|
RtlStringCbCopyA(FilePath, sizeof(FilePath), BootPath);
|
||||||
|
|
||||||
/* This is not a full path: prepend the SystemPartition */
|
/* This is not a full path: prepend the SystemPartition */
|
||||||
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
|
RtlStringCbCopyA(BootPath, sizeof(BootPath), SystemPartition);
|
||||||
|
|
||||||
/* Append a path separator if needed */
|
/* Append a path separator if needed */
|
||||||
if (*FileName != '\\' && *FileName != '/')
|
if (*FilePath != '\\' && *FilePath != '/')
|
||||||
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
|
RtlStringCbCatA(BootPath, sizeof(BootPath), "\\");
|
||||||
|
|
||||||
/* Append the remaining path */
|
/* Append the remaining path */
|
||||||
RtlStringCbCatA(BootPath, sizeof(BootPath), FileName);
|
RtlStringCbCatA(BootPath, sizeof(BootPath), FilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Append a path separator if needed */
|
/* Append a path separator if needed */
|
||||||
|
@ -946,17 +946,17 @@ LoadAndBootWindows(
|
||||||
|
|
||||||
TRACE("BootOptions: '%s'\n", BootOptions);
|
TRACE("BootOptions: '%s'\n", BootOptions);
|
||||||
|
|
||||||
/* Check if a ramdisk file was given */
|
/* Check if a RAM disk file was given */
|
||||||
File = strstr(BootOptions, "/RDPATH=");
|
FileName = strstr(BootOptions, "/RDPATH=");
|
||||||
if (File)
|
if (FileName)
|
||||||
{
|
{
|
||||||
/* Load the ramdisk */
|
/* Load the RAM disk */
|
||||||
Status = RamDiskInitialize(FALSE, BootOptions, SystemPartition);
|
Status = RamDiskInitialize(FALSE, BootOptions, SystemPartition);
|
||||||
if (Status != ESUCCESS)
|
if (Status != ESUCCESS)
|
||||||
{
|
{
|
||||||
File += 8;
|
FileName += 8;
|
||||||
UiMessageBox("Failed to load RAM disk file '%.*s'",
|
UiMessageBox("Failed to load RAM disk file '%.*s'",
|
||||||
strcspn(File, " \t"), File);
|
strcspn(FileName, " \t"), FileName);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue