summaryrefslogtreecommitdiff
path: root/BaseTools
diff options
context:
space:
mode:
authorMichael D Kinney <michael.d.kinney@intel.com>2026-07-16 00:13:25 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-09-13 22:05:51 +0300
commit203bf1ffa12e890e238d710c6c6cf9d15615951b (patch)
tree22a90e3c5334a24e2aed0a9280596f01c11f548e /BaseTools
parentcd2a06cd310b1e5b504a9d55e6b42e4d14681e34 (diff)
downloadedk2-master.tar.xz
BaseTools/FirmwareStorageFormat: Fix FV ext entry struct factory functionsHEADmaster
The Refine_FV_EXT_ENTRY_OEM_TYPE_Header() and Refine_FV_EXT_ENTRY_GUID_TYPE_Header() functions incorrectly return an instantiation attempt of the local class with `Structure` as an argument (e.g., `return ClassName(Structure)`) instead of returning the class itself (e.g., `return ClassName`). This causes FMMT to fail with: "expected EFI_FIRMWARE_VOLUME_EXT_ENTRY instance, got _ctypes.PyCStructType" When processing FVs that contain ext header entries of type 0x01 (OEM Type) or type 0x02 (GUID Type, used for FV UI Name when FvNameString = TRUE). Fix by returning the class directly, matching the pattern used by Refine_FV_Header() which correctly returns the class for subsequent .from_buffer_copy() calls. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r--BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py b/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py
index 35cd5b6369..6167028cd5 100644
--- a/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py
+++ b/BaseTools/Source/Python/FirmwareStorageFormat/FvHeader.py
@@ -80,7 +80,7 @@ def Refine_FV_EXT_ENTRY_OEM_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_EXT_EN
('TypeMask', c_uint32),
('Types', ARRAY(GUID, nums))
]
- return EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE(Structure)
+ return EFI_FIRMWARE_VOLUME_EXT_ENTRY_OEM_TYPE
class EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE_0(Structure):
_fields_ = [
@@ -102,7 +102,7 @@ def Refine_FV_EXT_ENTRY_GUID_TYPE_Header(nums: int) -> EFI_FIRMWARE_VOLUME_EXT_E
('FormatType', GUID),
('Data', ARRAY(c_uint8, nums))
]
- return EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE(Structure)
+ return EFI_FIRMWARE_VOLUME_EXT_ENTRY_GUID_TYPE
class EFI_FIRMWARE_VOLUME_EXT_ENTRY_USED_SIZE_TYPE(Structure):
_fields_ = [