Exit(), Calls – Intel Extensible Firmware Interface User Manual

Page 181

Advertising
background image

Services — Boot Services

Version 1.10

12/01/02

5-83

Exit()

Summary

Terminates the currently loaded EFI image and returns control to boot services.

Prototype

typedef
EFI_STATUS
Exit (

IN EFI_HANDLE

ImageHandle,

IN EFI_STATUS

ExitStatus,

IN UINTN

ExitDataSize,

IN CHAR16

*ExitData

OPTIONAL

);

Parameters

ImageHandle

Handle that identifies the image. This parameter is passed to the image
on entry.

ExitStatus

The image’s exit code.

ExitDataSize

The size, in bytes, of

ExitData

. Ignored if

ExitStatus

is

EFI_SUCCESS

.

ExitData

Pointer to a data buffer that includes a Null-terminated Unicode string,
optionally followed by additional binary data. The string is a description
that the caller may use to further indicate the reason for the image’s exit.

ExitData

is only valid if

ExitStatus

is something other than

EFI_SUCCESS

. The

ExitData

buffer must be allocated by calling

AllocatePool()

.

Description

The

Exit()

function terminates the image referenced by

ImageHandle

and returns control to

boot services. This function can only be called by the currently executing image. This function
may not be called if the image has already returned from its entry point
(

EFI_IMAGE_ENTRY_POINT

) or if it has loaded any child images that have not exited (all child

images must exit before this image can exit).

Using

Exit()

is similar to returning from the image’s

EFI_IMAGE_ENTRY_POINT

except that

Exit()

may also return additional

ExitData

.

Advertising