/** @file\r
General purpose supporting routines for FAT recovery PEIM\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
\r
This program and the accompanying materials are licensed and made available\r
under the terms and conditions of the BSD License which accompanies this\r
// Status = BlockDev->ReadFunc\r
// (PrivateData->PeiServices, BlockDev->PhysicalDevNo, Lba, BufferSize, Buffer);\r
//\r
- Status = BlockDev->BlockIo->ReadBlocks (\r
+ if (BlockDev->BlockIo2 != NULL) {\r
+ Status = BlockDev->BlockIo2->ReadBlocks (\r
+ (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
+ BlockDev->BlockIo2,\r
+ BlockDev->PhysicalDevNo,\r
+ Lba,\r
+ BufferSize,\r
+ Buffer\r
+ );\r
+ } else {\r
+ Status = BlockDev->BlockIo->ReadBlocks (\r
(EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),\r
BlockDev->BlockIo,\r
BlockDev->PhysicalDevNo,\r
BufferSize,\r
Buffer\r
);\r
+ }\r
\r
} else {\r
Status = FatReadDisk (\r
// No DBCS issues, just expand and add null terminate to end of string\r
//\r
while (*Fat != 0 && FatSize != 0) {\r
+ if (*Fat == ' ') {\r
+ break;\r
+ }\r
*String = *Fat;\r
String += 1;\r
Fat += 1;\r
FatSize -= 1;\r
- if (*Fat == ' ') {\r
- *String = 0;\r
- return ;\r
- }\r
}\r
+\r
+ *String = 0;\r
}\r
\r
\r