https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6e65e6b28d78eae93896a…
commit 6e65e6b28d78eae93896aeb95fc4876b83063c85
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Jun 10 19:24:04 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Fri Jun 11 02:21:47 2021 +0200
[NTOS:IO] Minor code style fixes (typos; improve comments/DPRINT; IN vs. OUT
parameter).
---
ntoskrnl/fstub/fstubex.c | 14 +++++++-------
ntoskrnl/io/iomgr/arcname.c | 36 +++++++++++++++++-------------------
2 files changed, 24 insertions(+), 26 deletions(-)
diff --git a/ntoskrnl/fstub/fstubex.c b/ntoskrnl/fstub/fstubex.c
index 84296e0a722..6e43f238e66 100644
--- a/ntoskrnl/fstub/fstubex.c
+++ b/ntoskrnl/fstub/fstubex.c
@@ -1852,7 +1852,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
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;
@@ -1865,7 +1865,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
}
/* 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)
@@ -1955,7 +1955,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
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)
@@ -1963,7 +1963,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
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
@@ -1973,7 +1973,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
(IopVerifyDiskSignature(DriveLayout, ArcDiskSignature, &Signature)))
&&
(DriveLayout->PartitionStyle == PARTITION_STYLE_MBR))
{
- /* Create arc name */
+ /* Create ARC name */
sprintf(ArcBuffer, "\\ArcName\\%s",
ArcDiskSignature->ArcName);
RtlInitAnsiString(&ArcNameStringA, ArcBuffer);
@@ -1995,7 +1995,7 @@ IoGetBootDiskInformation(IN OUT PBOOTDISK_INFORMATION
BootDiskInformation,
Signature = DriveLayout->Mbr.Signature;
}
- /* Create partial arc name */
+ /* Create partial ARC name */
sprintf(ArcBuffer, "%spartition(%lu)",
ArcDiskSignature->ArcName, PartitionNumber);
RtlInitAnsiString(&ArcNameStringA, ArcBuffer);
@@ -2524,7 +2524,7 @@ IoWritePartitionTableEx(IN PDEVICE_OBJECT DeviceObject,
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,
diff --git a/ntoskrnl/io/iomgr/arcname.c b/ntoskrnl/io/iomgr/arcname.c
index 2e7cbb968b1..c36af33a5e8 100644
--- a/ntoskrnl/io/iomgr/arcname.c
+++ b/ntoskrnl/io/iomgr/arcname.c
@@ -24,16 +24,14 @@ PCHAR IoLoaderArcBootDeviceName;
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
@@ -136,7 +134,7 @@ IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* 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);
@@ -178,7 +176,7 @@ IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK 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.
@@ -357,7 +355,7 @@ IopCreateArcNamesCd(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
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++)
@@ -413,7 +411,7 @@ NTSTATUS
NTAPI
IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN BOOLEAN SingleDisk,
- IN PBOOLEAN FoundBoot)
+ OUT PBOOLEAN FoundBoot)
{
PIRP Irp;
PVOID Data;
@@ -644,7 +642,7 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
goto Cleanup;
}
- /* Read a sector for computing checksum */
+ /* Read the first sector for computing checksum */
Irp = IoBuildSynchronousFsdRequest(IRP_MJ_READ,
DeviceObject,
PartitionBuffer,
@@ -677,7 +675,7 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
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];
@@ -692,7 +690,7 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
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
@@ -789,15 +787,15 @@ IopCreateArcNamesDisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
}
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");
}
}
}