[FREELDR]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 7 Oct 2010 19:16:09 +0000 (19:16 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 7 Oct 2010 19:16:09 +0000 (19:16 +0000)
Fix CDs checksum computation
[NTOSKRNL]
Fix ARC names accordingly

svn path=/trunk/; revision=49040

reactos/boot/freeldr/freeldr/arch/i386/hardware.c
reactos/ntoskrnl/io/iomgr/arcname.c

index f99e267..641bd8d 100644 (file)
@@ -1004,6 +1004,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey)
 
         /* Calculate the MBR checksum */
         for (i = 0; i < 2048 / sizeof(ULONG); i++) Checksum += Buffer[i];
+        Checksum = ~Checksum + 1;
         DPRINTM(DPRINT_HWDETECT, "Checksum: %x\n", Checksum);
 
         /* Fill out the ARC disk block */
index 003c9bf..0ff87d5 100644 (file)
@@ -368,7 +368,7 @@ IopAssignArcNamesToCdrom(IN PLOADER_PARAMETER_BLOCK LoaderBlock,
                                          ARC_DISK_SIGNATURE,
                                          ListEntry);
         /* And check if checksums and arc names match */
-        if (CheckSum == ArcDiskEntry->CheckSum &&
+        if (CheckSum + ArcDiskEntry->CheckSum == 0 &&
             strcmp(KeLoaderBlock->ArcBootDeviceName, ArcDiskEntry->ArcName) == 0)
         {
             IsBootCdRom = TRUE;