Extensible Firmware Interface Specification
72 12/12/00 Version 1.02
3.4.3 UnloadImage()
Summary
Unloads an image.
Prototype
EFI_STATUS
UnloadImage (
IN EFI_HANDLE ImageHandle
);
Parameters
ImageHandle Handle that identifies the image to be unloaded. Type EFI_HANDLE is
defined in Section 3.3.1.
Description
The UnloadImage() function unloads a previously loaded image.
There are three possible scenarios. If the image has not been started, the function unloads the
image and returns EFI_SUCCESS.
If the image has been started and has an Unload() entry point, control is passed to that entry
point. If the image’s unload function returns EFI_SUCCESS, the image is unloaded; otherwise,
the error returned by the image’s unload function is returned to the caller. The image unload
function is responsible for freeing all allocated memory and ensuring that there are no references to
any freed memory, or to the image itself, before returning EFI_SUCCESS.
If the image has been started and does not have an Unload() entry point, the function returns
EFI_UNSUPPORTED.
Status Codes Returned
EFI_SUCCESS The image has been unloaded.
EFI_UNSUPPORTED The image has been started, and does not support unload.
EFI_INVALID_PARAMETER ImageHandle is not a valid image handle.
Exit code from Unload handler Exit code from image’s unload function.