]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Disk/PartitionDxe/ElTorito.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / Disk / PartitionDxe / ElTorito.c
index f208194eacf5045c78eba38277f818a69633a81c..98e46e9d766a612f439bf5975f1b21c7d18b29b0 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   Decode an El Torito formatted CD-ROM\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -97,13 +97,13 @@ PartitionInstallElToritoChildHandles (
       break;\r
     }\r
 \r
-    Status = BlockIo->ReadBlocks (\r
-                        BlockIo,\r
-                        Media->MediaId,\r
-                        VolDescriptorLba,\r
-                        Media->BlockSize,\r
-                        VolDescriptor\r
-                        );\r
+    Status = DiskIo->ReadDisk (\r
+                       DiskIo,\r
+                       Media->MediaId,\r
+                       MultU64x32 (VolDescriptorLba, Media->BlockSize),\r
+                       Media->BlockSize,\r
+                       VolDescriptor\r
+                       );\r
     if (EFI_ERROR (Status)) {\r
       Found = Status;\r
       break;\r
@@ -111,8 +111,8 @@ PartitionInstallElToritoChildHandles (
     //\r
     // Check for valid volume descriptor signature\r
     //\r
-    if (VolDescriptor->Type == CDVOL_TYPE_END ||\r
-        CompareMem (VolDescriptor->Id, CDVOL_ID, sizeof (VolDescriptor->Id)) != 0\r
+    if (VolDescriptor->Unknown.Type == CDVOL_TYPE_END ||\r
+        CompareMem (VolDescriptor->Unknown.Id, CDVOL_ID, sizeof (VolDescriptor->Unknown.Id)) != 0\r
         ) {\r
       //\r
       // end of Volume descriptor list\r
@@ -123,30 +123,30 @@ PartitionInstallElToritoChildHandles (
     // Read the Volume Space Size from Primary Volume Descriptor 81-88 byte,\r
     // the 32-bit numerical values is stored in Both-byte orders\r
     //\r
-    if (VolDescriptor->Type == CDVOL_TYPE_CODED) {\r
-      VolSpaceSize = VolDescriptor->VolSpaceSize[0];\r
+    if (VolDescriptor->PrimaryVolume.Type == CDVOL_TYPE_CODED) {\r
+      VolSpaceSize = VolDescriptor->PrimaryVolume.VolSpaceSize[0];\r
     }\r
     //\r
     // Is it an El Torito volume descriptor?\r
     //\r
-    if (CompareMem (VolDescriptor->SystemId, CDVOL_ELTORITO_ID, sizeof (CDVOL_ELTORITO_ID) - 1) != 0) {\r
+    if (CompareMem (VolDescriptor->BootRecordVolume.SystemId, CDVOL_ELTORITO_ID, sizeof (CDVOL_ELTORITO_ID) - 1) != 0) {\r
       continue;\r
     }\r
     //\r
     // Read in the boot El Torito boot catalog\r
     //\r
-    Lba = UNPACK_INT32 (VolDescriptor->EltCatalog);\r
+    Lba = UNPACK_INT32 (VolDescriptor->BootRecordVolume.EltCatalog);\r
     if (Lba > Media->LastBlock) {\r
       continue;\r
     }\r
 \r
-    Status = BlockIo->ReadBlocks (\r
-                        BlockIo,\r
-                        Media->MediaId,\r
-                        Lba,\r
-                        Media->BlockSize,\r
-                        Catalog\r
-                        );\r
+    Status = DiskIo->ReadDisk (\r
+                       DiskIo,\r
+                       Media->MediaId,\r
+                       MultU64x32 (Lba, Media->BlockSize),\r
+                       Media->BlockSize,\r
+                       Catalog\r
+                       );\r
     if (EFI_ERROR (Status)) {\r
       DEBUG ((EFI_D_ERROR, "EltCheckDevice: error reading catalog %r\n", Status));\r
       continue;\r
@@ -166,7 +166,7 @@ PartitionInstallElToritoChildHandles (
       Check += CheckBuffer[Index];\r
     }\r
 \r
-    if (Check & 0xFFFF) {\r
+    if ((Check & 0xFFFF) != 0) {\r
       DEBUG ((EFI_D_ERROR, "EltCheckBootCatalog: El Torito boot catalog header checksum failed\n"));\r
       continue;\r
     }\r