From 4f0630274a8180ae0f1ead19c049c09acbf102f7 Mon Sep 17 00:00:00 2001 From: YBronst <157227982+YBronst@users.noreply.github.com> Date: Sat, 24 Oct 2026 22:27:45 +0000 Subject: [PATCH] Fix OemTableId comparison and RSDT index calculation in AcpiPatcher Applied symmetric OemTableId_NoSpace comparison to both Table->OemTableId and TableId in DropTableFromRSDT and DropTableFromXSDT. Fixed RSDT entry index macro usage in DropTableFromRSDT. Authored-by: Jules --- rEFIt_UEFI/Platform/AcpiPatcher.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rEFIt_UEFI/Platform/AcpiPatcher.cpp b/rEFIt_UEFI/Platform/AcpiPatcher.cpp index c9b6aeb3fd..4045cd703c 100644 --- a/rEFIt_UEFI/Platform/AcpiPatcher.cpp +++ b/rEFIt_UEFI/Platform/AcpiPatcher.cpp @@ -363,17 +363,17 @@ void DropTableFromRSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) CopyMem(&OTID[0], &Table->OemTableId, 8); //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && - (!TableId || OemTableId_NoSpace(Table->OemTableId) == TableId) && + (!TableId || OemTableId_NoSpace(Table->OemTableId) == OemTableId_NoSpace(TableId)) && (!Length || Table->Length == Length))) { continue; } - if (IsXsdtEntryMerged(IndexFromXsdtEntryPtr(Ptr))) { - DBG(" attempt to drop already merged table[%d]: %s %s %d ignored\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + if (IsXsdtEntryMerged(IndexFromRsdtEntryPtr(Ptr))) { + DBG(" attempt to drop already merged table[%d]: %s %s %d ignored\n", IndexFromRsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); continue; } // drop matching table by simply replacing entry with NULL *Ptr = 0; - DBG(" Table[%d]: %s %s %d dropped\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + DBG(" Table[%d]: %s %s %d dropped\n", IndexFromRsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); } } @@ -404,7 +404,7 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) CopyMem(&OTID[0], &Table->OemTableId, 8); //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && - (!TableId || OemTableId_NoSpace(Table->OemTableId) == TableId) && + (!TableId || OemTableId_NoSpace(Table->OemTableId) == OemTableId_NoSpace(TableId)) && (!Length || Table->Length == Length))) { continue; }