diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-28 15:12:50 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-04-28 15:12:50 +0200 |
| commit | 38dbf64f9007cd6104c63989b9b8311d4d1ffd76 (patch) | |
| tree | 5ee5d9fc3ef612fb164f3a4a4ddc95621740d2b7 /Private/NewBoot/BootKit | |
| parent | b608517c047f7e4f7d7d70af7db76b0e9b0873b0 (diff) | |
MHR-18: Support parent directories inside format class.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Private/NewBoot/BootKit')
| -rw-r--r-- | Private/NewBoot/BootKit/BootKit.hxx | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx index 14609e77..c3e438ae 100644 --- a/Private/NewBoot/BootKit/BootKit.hxx +++ b/Private/NewBoot/BootKit/BootKit.hxx @@ -185,11 +185,15 @@ public: Char fFileName[kNewFSNodeNameLen]; Char fForkName[kNewFSNodeNameLen]; - UInt32 fKind; + Int32 fKind; + Int64 fLba; VoidPtr fBlob; SizeT fBlobSz; + bool IsCatalogValid() { return fLba != 0 && fLba >= kNewFSCatalogStartAddress; } + + struct BFileDescriptor* fParent; struct BFileDescriptor* fPrev; struct BFileDescriptor* fNext; }; @@ -262,7 +266,17 @@ private: while (blob) { NewCatalog* catalogKind = (NewCatalog*)bufCatalog; - catalogKind->PrevSibling = startLba; + blob->fLba = startLba; + + if (!blob->fParent) + catalogKind->PrevSibling = startLba; + else { + if (blob->IsCatalogValid()) { + catalogKind->PrevSibling = blob->fParent->fLba; + } else { + EFI::ThrowError(L"Invalid-Catalog-Location", L"Invalid catalog location."); + } + } /// Fill catalog kind. catalogKind->Kind = blob->fKind; |
