[SETUPLIB] Adjustments in the code.

- Call OpenAndMapFile() with its new ReadWrite parameter;
- Add informative comments in osdetect.c;
- In partlist.c, check whether a disk has a valid MBR by also checking for its 0xAA55 signature.

svn path=/branches/setup_improvements/; revision=74712
This commit is contained in:
Hermès Bélusca-Maïto 2017-05-31 01:11:05 +00:00
parent 7f5428633b
commit 563d9f26c4
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
3 changed files with 20 additions and 6 deletions

View file

@ -150,6 +150,8 @@ EnumerateInstallations(
{
/* This is not a ReactOS entry */
/* Certainly not a ReactOS installation */
DPRINT1(" A Win2k3 install '%wZ' without an ARC path?!\n", &InstallName);
/* Continue the enumeration */
return STATUS_SUCCESS;
}
}
@ -171,6 +173,7 @@ EnumerateInstallations(
{
DPRINT1(" An NTOS installation with name \"%S\" already exists in SystemRoot '%wZ'\n",
NtOsInstall->InstallationName, &NtOsInstall->SystemArcPath);
/* Continue the enumeration */
return STATUS_SUCCESS;
}
@ -183,6 +186,7 @@ EnumerateInstallations(
if (!ArcPathToNtPath(&SystemRootPath, BootEntry->OsLoadPath, Data->PartList))
{
DPRINT1("ArcPathToNtPath(%S) failed, skip the installation.\n", BootEntry->OsLoadPath);
/* Continue the enumeration */
return STATUS_SUCCESS;
}
@ -198,6 +202,7 @@ EnumerateInstallations(
{
DPRINT1(" An NTOS installation with name \"%S\" already exists in SystemRoot '%wZ'\n",
NtOsInstall->InstallationName, &NtOsInstall->SystemNtPath);
/* Continue the enumeration */
return STATUS_SUCCESS;
}
@ -205,7 +210,10 @@ EnumerateInstallations(
/* Check if this is a valid NTOS installation; stop there if it isn't one */
if (!IsValidNTOSInstallation_UStr(&SystemRootPath))
{
/* Continue the enumeration */
return STATUS_SUCCESS;
}
DPRINT1("Found a valid NTOS installation in SystemRoot ARC path '%S', NT path '%wZ'\n",
BootEntry->OsLoadPath, &SystemRootPath);
@ -228,6 +236,7 @@ EnumerateInstallations(
DPRINT1("NtPathToDiskPartComponents(%wZ) failed\n", &SystemRootPath);
}
/* Add the discovered NTOS installation into the list */
if (PartEntry && PartEntry->DriveLetter)
{
/* We have retrieved a partition that is mounted */
@ -245,6 +254,7 @@ EnumerateInstallations(
DiskNumber, PartitionNumber, PartEntry,
InstallNameW);
/* Continue the enumeration */
return STATUS_SUCCESS;
}
@ -301,7 +311,8 @@ CheckForValidPEAndVendor(
VendorName->Length = 0;
Status = OpenAndMapFile(RootDirectory, PathNameToFile,
&FileHandle, &SectionHandle, &ViewBase, NULL);
&FileHandle, &SectionHandle, &ViewBase,
NULL, FALSE);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to open and map file '%S', Status 0x%08lx\n", PathNameToFile, Status);