aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthijs Lavrijsen <mattiwatti@gmail.com>2023-06-22 20:10:59 +0200
committerMatthijs Lavrijsen <mattiwatti@gmail.com>2023-06-22 20:10:59 +0200
commit3779ef2496e4f495c1f07e06e486a4bc13928ccf (patch)
tree40904fcb24995afc11463bfd117c98517bedaa8a
parentedd474d5ffede07931ebd51780f91ceea95043b9 (diff)
Fix build with current EDK2 master
Rename RUNTIME_FUNCTION to resolve a conflict with edk2's incomplete redefinition added in https://github.com/tianocore/edk2/commit/ff52068d9261b9391d75b83a2a4e40e040f3b6eb
-rw-r--r--EfiGuardDxe/pe.h4
-rw-r--r--EfiGuardDxe/util.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/EfiGuardDxe/pe.h b/EfiGuardDxe/pe.h
index 530d851..a2699d2 100644
--- a/EfiGuardDxe/pe.h
+++ b/EfiGuardDxe/pe.h
@@ -177,7 +177,7 @@ typedef struct _VS_VERSIONINFO
//
// Function table entry data
//
-typedef struct _RUNTIME_FUNCTION
+typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY
{
UINT32 BeginAddress;
UINT32 EndAddress;
@@ -186,7 +186,7 @@ typedef struct _RUNTIME_FUNCTION
UINT32 UnwindInfoAddress;
UINT32 UnwindData;
} u;
-} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;
+} IMAGE_RUNTIME_FUNCTION_ENTRY, *PIMAGE_RUNTIME_FUNCTION_ENTRY;
//
diff --git a/EfiGuardDxe/util.c b/EfiGuardDxe/util.c
index 7af5804..c15b7da 100644
--- a/EfiGuardDxe/util.c
+++ b/EfiGuardDxe/util.c
@@ -448,16 +448,16 @@ BacktrackToFunctionStart(
if (NtHeaders->OptionalHeader.NumberOfRvaAndSizes <= EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION)
return NULL;
- CONST PRUNTIME_FUNCTION FunctionTable = (PRUNTIME_FUNCTION)(ImageBase + NtHeaders->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress);
+ CONST PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionTable = (PIMAGE_RUNTIME_FUNCTION_ENTRY)(ImageBase + NtHeaders->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress);
CONST UINT32 FunctionTableSize = NtHeaders->OptionalHeader.DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size;
if (FunctionTableSize == 0)
return NULL;
// Do a binary search until we find the function that contains our address
CONST UINT32 RelativeAddress = (UINT32)(AddressInFunction - ImageBase);
- PRUNTIME_FUNCTION FunctionEntry = NULL;
+ PIMAGE_RUNTIME_FUNCTION_ENTRY FunctionEntry = NULL;
INT32 Low = 0;
- INT32 High = (INT32)(FunctionTableSize / sizeof(RUNTIME_FUNCTION)) - 1;
+ INT32 High = (INT32)(FunctionTableSize / sizeof(IMAGE_RUNTIME_FUNCTION_ENTRY)) - 1;
while (High >= Low)
{
@@ -477,7 +477,7 @@ BacktrackToFunctionStart(
// If the function entry specifies indirection, get the address of the master function entry
if ((FunctionEntry->u.UnwindData & RUNTIME_FUNCTION_INDIRECT) != 0)
{
- FunctionEntry = (PRUNTIME_FUNCTION)(FunctionEntry->u.UnwindData + ImageBase - 1);
+ FunctionEntry = (PIMAGE_RUNTIME_FUNCTION_ENTRY)(FunctionEntry->u.UnwindData + ImageBase - 1);
}
return (UINT8*)ImageBase + FunctionEntry->BeginAddress;