EFI LOADED IMAGE PROTOCOL

From PhoenixWiki

Jump to: navigation, search

Can be used on any image handle to obtain information about the loaded image.

Contents

GUID

#define EFI_LOADED_IMAGE_PROTOCOL_GUID\
  {0x5B1B31A1,0x9562,0x11d2,\
     0x8E,0x3F,0x00,0xA0,0xC9,0x69,0x72,0x3B}

Revision Number

#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000

Protocol Interface Structure

typedef struct {
  UINT32                    Revision;
  EFI_HANDLE                ParentHandle;
  EFI_SYSTEM_TABLE          *SystemTable;
  EFI_HANDLE                DeviceHandle;
  EFI_DEVICE_PATH_PROTOCOL  *FilePath;
  VOID                      *Reserved;
  UINT32                    LoadOptionsSize;
  VOID                      *LoadOptions;
  VOID                      *ImageBase;
  UINT64                    ImageSize;
  EFI_MEMORY_TYPE           ImageCodeType;
  EFI_MEMORY_TYPE           ImageDataType;
  EFI_IMAGE_UNLOAD          Unload;
} EFI_LOADED_IMAGE_PROTOCOL;

Members

Member Description
Revision Defines the revision of the EFI_LOADED_IMAGE_PROTOCOL structure. All future revisions will be backward compatible to the current revision.
ParentHandle Parent image’s image handle. NULL if the image is loaded directly from the firmware’s boot manager.
SystemTable The image’s EFI system table pointer.
DeviceHandle The device handle that the EFI Image was loaded from.
FilePath A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from.
Reserved Reserved. DO NOT USE.
LoadOptionsSize The size in bytes of LoadOptions.
LoadOptions A pointer to the image’s binary load options.
ImageBase The base address at which the image was loaded.
ImageSize The size in bytes of the loaded image.
ImageCodeType The memory type that the code sections were loaded as.
ImageDataType The memory type that the data sections were loaded as.
Unload Function that unloads the image. See Unload().

Description

Each loaded image has an image handle that supports EFI_LOADED_IMAGE_PROTOCOL. When an image is started, it is passed the image handle for itself. The image can use the handle to obtain its relevant image data stored in the EFI_LOADED_IMAGE_PROTOCOL structure, such as its load options.

Unload()

Unloads an image from memory.

Prototype

typedef
EFI_STATUS
(EFIAPI *EFI_IMAGE_UNLOAD) (
  IN EFI_HANDLE ImageHandle,
  );

Parameters

Parameter Description
ImageHandle The handle to the image to unload.

Description
The Unload() function unloads an image from memory if ImageHandle is valid.

Status Codes Returned

Status Code Description
EFI_SUCCESS The image was unloaded.
EFI_INVALID_PARAMETER The ImageHandle was not valid.

Copyright (C) 2008, 2010 Phoenix Technologies Ltd. All Rights Reserved. Portions (C) 2005 UEFI Forum, Inc. Used with permission.

Personal tools