]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/DxeServicesLib.h
Add new GetFileBufferByFilePath API into DxeServicesLib.
[mirror_edk2.git] / MdePkg / Include / Library / DxeServicesLib.h
index 898793398f07766401d6e2d391021ded5417f5ef..944535d4a08ae0b4c6b982dd366c6e5f4b4c03a9 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
   MDE DXE Services Library provides functions that simplify the development of DXE Drivers.  \r
-  These functions help access data from sections of FFS files.\r
+  These functions help access data from sections of FFS files or from file path.\r
 \r
-  Copyright (c) 2008, Intel Corporation<BR>                                                         \r
+  Copyright (c) 2008 - 2009, Intel Corporation<BR>                                                         \r
   All rights reserved. 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
@@ -154,5 +154,41 @@ GetSectionFromFfs (
   OUT UINTN                         *Size\r
   );\r
 \r
+\r
+/**\r
+  Get the image file buffer data and buffer size by its device path. \r
+  \r
+  Access the file either from a firmware volume, from a file system interface, \r
+  or from the load file interface.\r
+  \r
+  Allocate memory to store the found image. The caller is responsible to free memory.\r
+\r
+  If File is NULL, then NULL is returned.\r
+  If FileSize is NULL, then NULL is returned.\r
+  If AuthenticationStatus is NULL, then NULL is returned.\r
+\r
+  @param[in]       BootPolicy \r
+                             Policy for Open Image File.If TRUE, indicates that the request \r
+                             originates from the boot manager, and that the boot manager is\r
+                             attempting to load FilePath as a boot selection. If FALSE, \r
+                             then FilePath must match an exact file to be loaded.\r
+  @param[in]       File      Pointer to the device path of the file that is absracted to the file buffer.\r
+  @param[out]      FileSize  Pointer to the size of the abstracted file buffer.\r
+  @param[out]      AuthenticationStatus   \r
+                             Pointer to a caller-allocated UINT32 in which\r
+                             the authentication status is returned.\r
+\r
+  @retval NULL   File is NULL, or FileSize is NULL. Or the file can't be found.\r
+  @retval other  The abstracted file buffer. The caller is responsible to free memory.\r
+**/\r
+VOID *\r
+EFIAPI\r
+GetFileBufferByFilePath (\r
+  IN BOOLEAN                           BootPolicy,\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL    *FilePath,\r
+  OUT      UINTN                       *FileSize,\r
+  OUT UINT32                           *AuthenticationStatus\r
+  );\r
+\r
 #endif\r
 \r