From abdde5b4193ecedadcc772f00ff314e1880475b6 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 25 Apr 2021 21:46:34 -0500 Subject: UX payloads are never external, part 2. --- src/engine/cache.cpp | 32 ++------------------------------ src/engine/cache.h | 2 -- src/engine/core.cpp | 4 ++-- src/engine/engine.cpp | 2 +- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/src/engine/cache.cpp b/src/engine/cache.cpp index 2a40010d..fcc7f72d 100644 --- a/src/engine/cache.cpp +++ b/src/engine/cache.cpp @@ -97,7 +97,6 @@ static HRESULT CopyEngineToWorkingFolder( __in_z LPCWSTR wzSourcePath, __in_z LPCWSTR wzWorkingFolderName, __in_z LPCWSTR wzExecutableName, - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczEngineWorkingPath ); @@ -743,7 +742,6 @@ extern "C" BOOL CacheBundleRunningFromCache() } extern "C" HRESULT CacheBundleToCleanRoom( - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath ) @@ -757,7 +755,7 @@ extern "C" HRESULT CacheBundleToCleanRoom( wzExecutableName = PathFile(sczSourcePath); - hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME, wzExecutableName, pUxPayloads, pSection, psczCleanRoomBundlePath); + hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczCleanRoomBundlePath); ExitOnFailure(hr, "Failed to cache bundle to clean room."); LExit: @@ -769,7 +767,6 @@ LExit: extern "C" HRESULT CacheBundleToWorkingDirectory( __in_z LPCWSTR /*wzBundleId*/, __in_z LPCWSTR wzExecutableName, - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczEngineWorkingPath ) @@ -792,7 +789,7 @@ extern "C" HRESULT CacheBundleToWorkingDirectory( } else // otherwise, carry on putting the bundle in the working folder. { - hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pUxPayloads, pSection, psczEngineWorkingPath); + hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczEngineWorkingPath); ExitOnFailure(hr, "Failed to copy engine to working folder."); } @@ -1767,7 +1764,6 @@ static HRESULT CopyEngineToWorkingFolder( __in_z LPCWSTR wzSourcePath, __in_z LPCWSTR wzWorkingFolderName, __in_z LPCWSTR wzExecutableName, - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczEngineWorkingPath ) @@ -1796,30 +1792,6 @@ static HRESULT CopyEngineToWorkingFolder( hr = CopyEngineWithSignatureFixup(pSection->hEngineFile, wzSourcePath, sczTargetPath, pSection); ExitOnFailure(hr, "Failed to copy engine: '%ls' to working path: %ls", wzSourcePath, sczTargetPath); - // Copy external UX payloads to working path. - for (DWORD i = 0; i < pUxPayloads->cPayloads; ++i) - { - BURN_PAYLOAD* pPayload = &pUxPayloads->rgPayloads[i]; - - if (BURN_PAYLOAD_PACKAGING_EXTERNAL == pPayload->packaging) - { - if (!sczSourceDirectory) - { - hr = PathGetDirectory(wzSourcePath, &sczSourceDirectory); - ExitOnFailure(hr, "Failed to get directory from engine path: %ls", wzSourcePath); - } - - hr = PathConcat(sczSourceDirectory, pPayload->sczSourcePath, &sczPayloadSourcePath); - ExitOnFailure(hr, "Failed to build payload source path for working copy."); - - hr = PathConcat(sczTargetDirectory, pPayload->sczFilePath, &sczPayloadTargetPath); - ExitOnFailure(hr, "Failed to build payload target path for working copy."); - - hr = FileEnsureCopyWithRetry(sczPayloadSourcePath, sczPayloadTargetPath, TRUE, FILE_OPERATION_RETRY_COUNT, FILE_OPERATION_RETRY_WAIT); - ExitOnFailure(hr, "Failed to copy UX payload from: '%ls' to: '%ls'", sczPayloadSourcePath, sczPayloadTargetPath); - } - } - if (psczEngineWorkingPath) { hr = StrAllocString(psczEngineWorkingPath, sczTargetPath, 0); diff --git a/src/engine/cache.h b/src/engine/cache.h index a2ac1696..0152d33b 100644 --- a/src/engine/cache.h +++ b/src/engine/cache.h @@ -124,14 +124,12 @@ void CacheSendErrorCallback( ); BOOL CacheBundleRunningFromCache(); HRESULT CacheBundleToCleanRoom( - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath ); HRESULT CacheBundleToWorkingDirectory( __in_z LPCWSTR wzBundleId, __in_z LPCWSTR wzExecutableName, - __in BURN_PAYLOADS* pUxPayloads, __in BURN_SECTION* pSection, __deref_out_z_opt LPWSTR* psczEngineWorkingPath ); diff --git a/src/engine/core.cpp b/src/engine/core.cpp index baba55f6..aea614d2 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp @@ -579,7 +579,7 @@ extern "C" HRESULT CoreElevate( // If the elevated companion pipe isn't created yet, let's make that happen. if (!pEngineState->sczBundleEngineWorkingPath) { - hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); + hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); ExitOnFailure(hr, "Failed to cache engine to working directory."); } @@ -678,7 +678,7 @@ extern "C" HRESULT CoreApply( // Ensure the engine is cached to the working path. if (!pEngineState->sczBundleEngineWorkingPath) { - hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); + hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); ExitOnFailure(hr, "Failed to cache engine to working directory."); } diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 458386d4..bb4061a7 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -454,7 +454,7 @@ static HRESULT RunUntrusted( } else { - hr = CacheBundleToCleanRoom(&pEngineState->userExperience.payloads, &pEngineState->section, &sczCachedCleanRoomBundlePath); + hr = CacheBundleToCleanRoom(&pEngineState->section, &sczCachedCleanRoomBundlePath); ExitOnFailure(hr, "Failed to cache to clean room."); wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath; -- cgit v1.2.3-55-g6feb