//\r
// NOTE: Only one Type 1 (Physical) Partition is supported. It has been\r
// checked already in Partition driver for existence of a single Type 1\r
- // Partition map, so we don't have to double check here.\r
+ // Partition map. Hence, the 'PartitionReferenceNumber' field (the index\r
+ // used to access Partition Maps data within the Logical Volume Descriptor)\r
+ // in the Long Allocation Descriptor should be 0 to indicate there is only\r
+ // one partition.\r
//\r
- // Partition reference number can also be retrieved from\r
- // LongAd->ExtentLocation.PartitionReferenceNumber, however the spec says\r
- // it may be 0, so let's not rely on it.\r
+ if (LongAd->ExtentLocation.PartitionReferenceNumber != 0) {\r
+ return NULL;\r
+ }\r
+ //\r
+ // Since only one partition, get the first one directly.\r
//\r
PartitionNum = *(UINT16 *)((UINTN)&LogicalVolDesc->PartitionMaps[4]);\r
break;\r