-Routine Description:\r
- given the supplied FW_VOL_BLOCK_PROTOCOL, allocate a buffer for output and\r
- copy the volume header into it.\r
+ //\r
+ // Read data from the crossing blocks\r
+ //\r
+ BlockIndex = 0; \r
+ while (BlockIndex < NumberOfBlocks && DataSize >= BlockSize) {\r
+ Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &BlockSize, Data);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ Data += BlockSize;\r
+ DataSize -= BlockSize;\r
+ BlockIndex ++;\r
+ }\r
+ \r
+ //\r
+ // Data doesn't exceed the current block range.\r
+ //\r
+ if (DataSize < BlockSize) {\r
+ break;\r
+ }\r
+ \r
+ //\r
+ // Data must be got from the next block range.\r
+ //\r
+ *StartLba += NumberOfBlocks;\r
+ }\r
+ \r
+ //\r
+ // read the remaining data\r
+ //\r
+ if (DataSize > 0) {\r
+ Status = Fvb->Read (Fvb, *StartLba + BlockIndex, 0, &DataSize, Data);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+ }\r
+ \r
+ //\r
+ // Update Lba and Offset used by the following read.\r
+ //\r
+ *StartLba += BlockIndex;\r
+ *Offset = DataSize;\r
+\r
+ return EFI_SUCCESS;\r
+}\r