PAGED_CODE();
- /* Get loader block. If it's null, we come to late */
+ /* Get loader block. If it's null, we come too late */
if (!IopLoaderBlock)
{
return STATUS_TOO_LATE;
}
/* Init some useful stuff:
- * Get arc disks information
+ * Get ARC disks information
* Check whether we have a single disk
* Check received structure size (extended or not?)
* Init boot strings (system/boot)
DiskGeometry.BytesPerSector = 512;
}
- /* Now, for each arc disk, try to find the matching */
+ /* Now, for each ARC disk, try to find the matching */
for (NextEntry = ArcDiskInformation->DiskSignatureListHead.Flink;
NextEntry != &ArcDiskInformation->DiskSignatureListHead;
NextEntry = NextEntry->Flink)
ArcDiskSignature = CONTAINING_RECORD(NextEntry,
ARC_DISK_SIGNATURE,
ListEntry);
- /* If they matches, ie
+ /* If they match, i.e.
* - There's only one disk for both BIOS and detected
* - Signatures are matching
* - This is MBR
(IopVerifyDiskSignature(DriveLayout, ArcDiskSignature, &Signature))) &&
(DriveLayout->PartitionStyle == PARTITION_STYLE_MBR))
{
- /* Create arc name */
+ /* Create ARC name */
sprintf(ArcBuffer, "\\ArcName\\%s", ArcDiskSignature->ArcName);
RtlInitAnsiString(&ArcNameStringA, ArcBuffer);
Signature = DriveLayout->Mbr.Signature;
}
- /* Create partial arc name */
+ /* Create partial ARC name */
sprintf(ArcBuffer, "%spartition(%lu)", ArcDiskSignature->ArcName, PartitionNumber);
RtlInitAnsiString(&ArcNameStringA, ArcBuffer);
FALSE,
DriveLayout->PartitionCount,
DriveLayout->PartitionEntry);
- /* If it succeed, also update backup table */
+ /* If it succeeded, also update backup table */
if (NT_SUCCESS(Status))
{
Status = FstubWritePartitionTableEFI(Disk,
CODE_SEG("INIT")
NTSTATUS
NTAPI
-IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK LoaderBlock
-);
+IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK LoaderBlock);
CODE_SEG("INIT")
NTSTATUS
NTAPI
IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN BOOLEAN SingleDisk,
- IN PBOOLEAN FoundBoot
-);
+ OUT PBOOLEAN FoundBoot);
CODE_SEG("INIT")
NTSTATUS
/* Loop every disk and try to find boot disk */
Status = IopCreateArcNamesDisk(LoaderBlock, SingleDisk, &FoundBoot);
- /* If it succeed but we didn't find boot device, try to browse Cds */
+ /* If it succeeded but we didn't find boot device, try to browse Cds */
if (NT_SUCCESS(Status) && !FoundBoot)
{
Status = IopCreateArcNamesCd(LoaderBlock);
* that have been successfully handled by MountMgr driver
* and that already own their device name. This is the "new" way
* to handle them, that came with NT5.
- * Currently, Windows 2003 provides an arc names creation based
+ * Currently, Windows 2003 provides an ARC names creation based
* on both enabled drives and not enabled drives (lack from
* the driver).
* Given the current ReactOS state, that's good for us.
Status = IoStatusBlock.Status;
}
- /* Reading succeed, compute checksum by adding data, 2048 bytes checksum */
+ /* If reading succeeded, compute checksum by adding data, 2048 bytes checksum */
if (NT_SUCCESS(Status))
{
for (i = 0; i < 2048 / sizeof(ULONG); i++)
NTAPI
IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN BOOLEAN SingleDisk,
- IN PBOOLEAN FoundBoot)
+ OUT PBOOLEAN FoundBoot)
{
PIRP Irp;
PVOID Data;
goto Cleanup;
}
- /* Read a sector for computing checksum */
+ /* Read the first sector for computing checksum */
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
DeviceObject,
PartitionBuffer,
ObDereferenceObject(FileObject);
- /* Calculate checksum, that's an easy computation, just adds read data */
+ /* Calculate checksum by adding data */
for (i = 0, CheckSum = 0; i < 512 / sizeof(ULONG) ; i++)
{
CheckSum += PartitionBuffer[i];
ARC_DISK_SIGNATURE,
ListEntry);
- /* If they matches, ie
+ /* If they match, i.e.
* - There's only one disk for both BIOS and detected/enabled
* - Signatures are matching
* - Checksums are matching
}
else
{
- /* In case there's a valid partition, a matching signature,
- BUT a none matching checksum, or there's a duplicate
- signature, or even worse a virus played with partition
- table */
- if (ArcDiskSignature->Signature == Signature &&
- (ArcDiskSignature->CheckSum + CheckSum != 0) &&
- ArcDiskSignature->ValidPartitionTable)
+ /* Debugging feedback: Warn in case there's a valid partition,
+ * a matching signature, BUT a non-matching checksum: this can
+ * be the sign of a duplicate signature, or even worse a virus
+ * played with the partition table. */
+ if (ArcDiskSignature->ValidPartitionTable &&
+ (ArcDiskSignature->Signature == Signature) &&
+ (ArcDiskSignature->CheckSum + CheckSum != 0))
{
- DPRINT("Be careful, or you have a duplicate disk signature, or a virus altered your MBR!\n");
+ DPRINT("Be careful, you have a duplicate disk signature, or a virus altered your MBR!\n");
}
}
}