From 04eff6d8290ea8f3be0c7e8447b73451a2263bb8 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 29 Apr 2020 18:57:50 +1000 Subject: Implement fDisableUnloading for the BA. --- src/engine/engine.vcxproj | 4 ++-- src/engine/packages.config | 2 +- src/engine/userexperience.cpp | 7 ++++--- src/engine/userexperience.h | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/engine') diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index b0c3e295..6fd9d64a 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj @@ -2,7 +2,7 @@ - + @@ -166,7 +166,7 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc" This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + diff --git a/src/engine/packages.config b/src/engine/packages.config index 38569fda..e9b2d190 100644 --- a/src/engine/packages.config +++ b/src/engine/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 4d149e9a..24fc1ec7 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp @@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad( args.pCommand = pCommand; args.pfnBootstrapperEngineProc = EngineForApplicationProc; args.pvBootstrapperEngineProcContext = pEngineContext; - args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 6); // TODO: need to decide whether to keep this, and if so when to update it. + args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 7); // TODO: need to decide whether to keep this, and if so when to update it. results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); @@ -115,6 +115,7 @@ extern "C" HRESULT UserExperienceLoad( pUserExperience->pfnBAProc = results.pfnBootstrapperApplicationProc; pUserExperience->pvBAProcContext = results.pvBootstrapperApplicationProcContext; + pUserExperience->fDisableUnloading = results.fDisableUnloading; LExit: return hr; @@ -139,8 +140,8 @@ extern "C" HRESULT UserExperienceUnload( pfnDestroy(); } - // Free BA DLL. - if (!::FreeLibrary(pUserExperience->hUXModule)) + // Free BA DLL if it supports it. + if (!pUserExperience->fDisableUnloading && !::FreeLibrary(pUserExperience->hUXModule)) { hr = HRESULT_FROM_WIN32(::GetLastError()); TraceError(hr, "Failed to unload BA DLL."); diff --git a/src/engine/userexperience.h b/src/engine/userexperience.h index 5aade0f2..7d2b743d 100644 --- a/src/engine/userexperience.h +++ b/src/engine/userexperience.h @@ -25,6 +25,7 @@ typedef struct _BURN_USER_EXPERIENCE HMODULE hUXModule; PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBAProc; LPVOID pvBAProcContext; + BOOL fDisableUnloading; LPWSTR sczTempDirectory; CRITICAL_SECTION csEngineActive; // Changing the engine active state in the user experience must be -- cgit v1.2.3-55-g6feb