From 0d873d28c2dd18444afa08b748e91f495ed1cf5c Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 15 Nov 2020 19:54:20 -0600 Subject: Add plan tests. --- src/engine/container.cpp | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'src/engine/container.cpp') diff --git a/src/engine/container.cpp b/src/engine/container.cpp index ada9025b..55a16afb 100644 --- a/src/engine/container.cpp +++ b/src/engine/container.cpp @@ -17,7 +17,6 @@ static HRESULT GetAttachedContainerInfo( // function definitions extern "C" HRESULT ContainersParseFromXml( - __in BURN_SECTION* pSection, __in BURN_CONTAINERS* pContainers, __in IXMLDOMNode* pixnBundle ) @@ -128,14 +127,6 @@ extern "C" HRESULT ContainersParseFromXml( ExitOnFailure(hr, "Failed to get @Hash."); } - // If the container is attached, make sure the information in the section matches what the - // manifest contained and get the offset to the container. - if (pContainer->fAttached) - { - hr = SectionGetAttachedContainerInfo(pSection, pContainer->dwAttachedIndex, pContainer->type, &pContainer->qwAttachedOffset, &pContainer->qwFileSize, &pContainer->fActuallyAttached); - ExitOnFailure(hr, "Failed to get attached container information."); - } - // prepare next iteration ReleaseNullObject(pixnNode); } @@ -150,6 +141,33 @@ LExit: return hr; } +extern "C" HRESULT ContainersInitialize( + __in BURN_CONTAINERS* pContainers, + __in BURN_SECTION* pSection + ) +{ + HRESULT hr = S_OK; + + if (pContainers->rgContainers) + { + for (DWORD i = 0; i < pContainers->cContainers; ++i) + { + BURN_CONTAINER* pContainer = &pContainers->rgContainers[i]; + + // If the container is attached, make sure the information in the section matches what the + // manifest contained and get the offset to the container. + if (pContainer->fAttached) + { + hr = SectionGetAttachedContainerInfo(pSection, pContainer->dwAttachedIndex, pContainer->type, &pContainer->qwAttachedOffset, &pContainer->qwFileSize, &pContainer->fActuallyAttached); + ExitOnFailure(hr, "Failed to get attached container information."); + } + } + } + +LExit: + return hr; +} + extern "C" void ContainersUninitialize( __in BURN_CONTAINERS* pContainers ) -- cgit v1.2.3-55-g6feb