/** @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
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
//\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
// 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
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