MDE DXE Services Library provides functions that simplify the development of DXE Drivers. \r
These functions help access data from sections of FFS files or from file path.\r
\r
- Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2007 - 2015, 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
}\r
\r
if (!EFI_ERROR (Status) && (FileInfo != NULL)) {\r
- //\r
- // Allocate space for the file\r
- //\r
- ImageBuffer = AllocatePool ((UINTN)FileInfo->FileSize);\r
- if (ImageBuffer == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- } else {\r
+ if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == 0) {\r
//\r
- // Read the file into the buffer we allocated\r
+ // Allocate space for the file\r
//\r
- ImageBufferSize = (UINTN)FileInfo->FileSize;\r
- Status = FileHandle->Read (FileHandle, &ImageBufferSize, ImageBuffer);\r
+ ImageBuffer = AllocatePool ((UINTN)FileInfo->FileSize);\r
+ if (ImageBuffer == NULL) {\r
+ Status = EFI_OUT_OF_RESOURCES;\r
+ } else {\r
+ //\r
+ // Read the file into the buffer we allocated\r
+ //\r
+ ImageBufferSize = (UINTN)FileInfo->FileSize;\r
+ Status = FileHandle->Read (FileHandle, &ImageBufferSize, ImageBuffer);\r
+ }\r
}\r
}\r
}\r