4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync MDE DXE Services Library provides functions that simplify the development of DXE Drivers.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync These functions help access data from sections of FFS files or from file path.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncCopyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncThis program and the accompanying materials are licensed and made available under
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncthe terms and conditions of the BSD License that accompanies this distribution.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncThe full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynchttp://opensource.org/licenses/bsd-license.php.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#ifndef __DXE_SERVICES_LIB_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define __DXE_SERVICES_LIB_H__
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Searches all the available firmware volumes and returns the first matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function searches all the firmware volumes for FFS files with FV file type specified by FileType
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The order that the firmware volumes is searched is not deterministic. For each available FV a search
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is made for FFS file of type FileType. If the FV contains more than one FFS file with the same FileType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the FileInstance instance will be the matched FFS file. For each FFS file found a search
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to use FreePool() to free the allocated buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are retrieved from an FFS file based on SectionType and SectionInstance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the search will be retried with a section type of EFI_SECTION_PE32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must be called with a TPL <= TPL_NOTIFY.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Size is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param FileType Indicates the FV file type to search for within all available FVs.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param FileInstance Indicates which file instance within all available FVs specified by FileType.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync FileInstance starts from zero.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionType Indicates the FFS section type to search for within the FFS file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by FileType with FileInstance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionInstance Indicates which section instance within the FFS file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by FileType with FileInstance to retrieve. SectionInstance starts from zero.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer On output, a pointer to a callee allocated buffer containing the FFS file section that was found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Is it the caller's responsibility to free this buffer using FreePool().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Size On output, a pointer to the size, in bytes, of Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The specified FFS section was returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND The specified FFS section could not be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve the matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a device error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the firmware volume that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync contains the matching FFS section does not allow reads.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncGetSectionFromAnyFvByFileType (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_FV_FILETYPE FileType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN FileInstance,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_SECTION_TYPE SectionType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SectionInstance,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID **Buffer,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *Size
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Searches all the available firmware volumes and returns the first matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function searches all the firmware volumes for FFS files with an FFS filename specified by NameGuid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync The order in which the firmware volumes are searched is not deterministic. For each FFS file found, a search
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance instances
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to use FreePool() to free the allocated buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are retrieved from an FFS file based on SectionType and SectionInstance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the search will be retried with a section type of EFI_SECTION_PE32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must be called with a TPL <= TPL_NOTIFY.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If NameGuid is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Size is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param NameGuid A pointer to to the FFS filename GUID to search for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync within any of the firmware volumes in the platform.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionType Indicates the FFS section type to search for within
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the FFS file specified by NameGuid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionInstance Indicates which section instance within the FFS file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by NameGuid to retrieve.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer On output, a pointer to a callee-allocated buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync containing the FFS file section that was found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to free this
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync buffer using FreePool().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Size On output, a pointer to the size, in bytes, of Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The specified FFS section was returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND The specified FFS section could not be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync device error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync firmware volume that contains the matching FFS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync section does not allow reads.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncGetSectionFromAnyFv (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST EFI_GUID *NameGuid,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_SECTION_TYPE SectionType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SectionInstance,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID **Buffer,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *Size
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Searches the firmware volume that the currently executing module was loaded from and returns the first matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function searches the firmware volume that the currently executing module was loaded
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync from for an FFS file with an FFS filename specified by NameGuid. If the FFS file is found, a search
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync is made for FFS sections of type SectionType. If the FFS file contains at least SectionInstance
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync instances of the FFS section specified by SectionType, then the SectionInstance instance is returned in Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Buffer is allocated using AllocatePool(), and the size of the allocated buffer is returned in Size.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to use FreePool() to free the allocated buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for details on how sections are retrieved from
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync an FFS file based on SectionType and SectionInstance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the currently executing module was not loaded from a firmware volume, then EFI_NOT_FOUND is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the search will be retried with a section type of EFI_SECTION_PE32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must be called with a TPL <= TPL_NOTIFY.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If NameGuid is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Size is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param NameGuid A pointer to to the FFS filename GUID to search for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync within the firmware volumes that the currently
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync executing module was loaded from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionType Indicates the FFS section type to search for within
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the FFS file specified by NameGuid.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionInstance Indicates which section instance within the FFS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync file specified by NameGuid to retrieve.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer On output, a pointer to a callee allocated buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync containing the FFS file section that was found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to free this buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync using FreePool().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Size On output, a pointer to the size, in bytes, of Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The specified FFS section was returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND The specified FFS section could not be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync device error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync firmware volume that contains the matching FFS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync section does not allow reads.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncGetSectionFromFv (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST EFI_GUID *NameGuid,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_SECTION_TYPE SectionType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SectionInstance,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID **Buffer,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *Size
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Searches the FFS file the the currently executing module was loaded from and returns the first matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function searches the FFS file that the currently executing module was loaded from for a FFS sections of type SectionType.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the FFS file contains at least SectionInstance instances of the FFS section specified by SectionType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync then the SectionInstance instance is returned in Buffer. Buffer is allocated using AllocatePool(),
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and the size of the allocated buffer is returned in Size. It is the caller's responsibility
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to use FreePool() to free the allocated buffer. See EFI_FIRMWARE_VOLUME2_PROTOCOL.ReadSection() for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync details on how sections are retrieved from an FFS file based on SectionType and SectionInstance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If the currently executing module was not loaded from an FFS file, then EFI_NOT_FOUND is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If SectionType is EFI_SECTION_TE, and the search with an FFS file fails,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the search will be retried with a section type of EFI_SECTION_PE32.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function must be called with a TPL <= TPL_NOTIFY.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Buffer is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If Size is NULL, then ASSERT().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionType Indicates the FFS section type to search for within
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the FFS file that the currently executing module
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync was loaded from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param SectionInstance Indicates which section instance to retrieve within
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the FFS file that the currently executing module
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync was loaded from.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer On output, a pointer to a callee allocated buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync containing the FFS file section that was found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It is the caller's responsibility to free this buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync using FreePool().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Size On output, a pointer to the size, in bytes, of Buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The specified FFS section was returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NOT_FOUND The specified FFS section could not be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES There are not enough resources available to retrieve
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the matching FFS section.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The FFS section could not be retrieves due to a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync device error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ACCESS_DENIED The FFS section could not be retrieves because the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync firmware volume that contains the matching FFS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync section does not allow reads.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncGetSectionFromFfs (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_SECTION_TYPE SectionType,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN SectionInstance,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID **Buffer,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *Size
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Get the image file buffer data and buffer size by its device path.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Access the file either from a firmware volume, from a file system interface,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync or from the load file interface.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Allocate memory to store the found image. The caller is responsible to free memory.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If File is NULL, then NULL is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If FileSize is NULL, then NULL is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If AuthenticationStatus is NULL, then NULL is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] BootPolicy The policy for Open Image File.If TRUE,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync indicates that the request originates from
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the boot manager, and that the boot manager is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync attempting to load FilePath as a boot selection.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync If FALSE, then FilePath must match an exact
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync file to be loaded.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[in] FilePath Pointer to the device path of the file that is abstracted to
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the file buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] FileSize Pointer to the size of the abstracted file buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param[out] AuthenticationStatus Pointer to a caller-allocated UINT32 in which the authentication
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync status is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval NULL File is NULL, or FileSize is NULL, or the file can't be found.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval other The abstracted file buffer. The caller is responsible to free memory.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncVOID *
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncGetFileBufferByFilePath (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN BOOLEAN BootPolicy,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CONST EFI_DEVICE_PATH_PROTOCOL *FilePath,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINTN *FileSize,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT UINT32 *AuthenticationStatus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync