ImageTool: Update RelocateImage internal prototype

This commit is contained in:
Marvin Häuser 2023-06-03 15:53:23 +02:00 committed by MikhailKrichanov
parent c6265d1374
commit e239aed80d
3 changed files with 17 additions and 13 deletions

View File

@ -98,7 +98,7 @@ RETURN_STATUS
UefiImageRelocateImagePe (
IN OUT UEFI_IMAGE_LOADER_IMAGE_CONTEXT *Context,
IN UINT64 BaseAddress,
OUT UEFI_IMAGE_LOADER_RUNTIME_CONTEXT *RuntimeContext OPTIONAL,
OUT VOID *RuntimeContext OPTIONAL,
IN UINT32 RuntimeContextSize
)
{

View File

@ -73,7 +73,7 @@ RETURN_STATUS
(*UEFI_IMAGE_RELOCARE_IMAGE) (
IN OUT UEFI_IMAGE_LOADER_IMAGE_CONTEXT *Context,
IN UINT64 BaseAddress,
OUT UEFI_IMAGE_LOADER_RUNTIME_CONTEXT *RuntimeContext OPTIONAL,
OUT VOID *RuntimeContext OPTIONAL,
IN UINT32 RuntimeContextSize
);

View File

@ -285,12 +285,16 @@ UefiImageRelocateImage (
)
{
RETURN_STATUS Status;
VOID *FormatContext;
UINT32 FormatContextSize;
FormatContext = RuntimeContext;
FormatContextSize = RuntimeContextSize;
if (RuntimeContext != NULL) {
*(UINT64 *)RuntimeContext = Context->FormatIndex;
RuntimeContext = (UEFI_IMAGE_LOADER_RUNTIME_CONTEXT *)((UINT64 *)RuntimeContext + 1);
ASSERT (RuntimeContextSize >= 8);
RuntimeContextSize -= 8;
FormatContext = (VOID *)((UINT64 *)RuntimeContext + 1);
ASSERT (FormatContextSize >= 8);
FormatContextSize -= 8;
}
UEFI_IMAGE_EXEC (
@ -299,8 +303,8 @@ UefiImageRelocateImage (
RelocateImage,
Context,
BaseAddress,
RuntimeContext,
RuntimeContextSize
FormatContext,
FormatContextSize
);
if (!RETURN_ERROR (Status)) {