aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/registration.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-08-03 15:41:18 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-04 10:03:57 -0500
commit6d7a275edafb3ae0f3cff94d66503a82dafb71f7 (patch)
treefae8f75e2cd1d7b179b0ed93e15625d68ba7c441 /src/burn/engine/registration.cpp
parented57d171f6fb6bb4e180696cc12caa568599566a (diff)
downloadwix-6d7a275edafb3ae0f3cff94d66503a82dafb71f7.tar.gz
wix-6d7a275edafb3ae0f3cff94d66503a82dafb71f7.tar.bz2
wix-6d7a275edafb3ae0f3cff94d66503a82dafb71f7.zip
Replace static cache internals with a struct.
Initialize them explicitly to make it clearer when that happens.
Diffstat (limited to 'src/burn/engine/registration.cpp')
-rw-r--r--src/burn/engine/registration.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp
index 0a8fb602..d1c32b3e 100644
--- a/src/burn/engine/registration.cpp
+++ b/src/burn/engine/registration.cpp
@@ -42,7 +42,8 @@ static HRESULT ParseSoftwareTagsFromXml(
42 __out DWORD* pcSoftwareTags 42 __out DWORD* pcSoftwareTags
43 ); 43 );
44static HRESULT SetPaths( 44static HRESULT SetPaths(
45 __in BURN_REGISTRATION* pRegistration 45 __in BURN_REGISTRATION* pRegistration,
46 __in BURN_CACHE* pCache
46 ); 47 );
47static HRESULT GetBundleManufacturer( 48static HRESULT GetBundleManufacturer(
48 __in BURN_REGISTRATION* pRegistration, 49 __in BURN_REGISTRATION* pRegistration,
@@ -120,6 +121,7 @@ static BOOL IsRegistryRebootPending();
120*******************************************************************/ 121*******************************************************************/
121extern "C" HRESULT RegistrationParseFromXml( 122extern "C" HRESULT RegistrationParseFromXml(
122 __in BURN_REGISTRATION* pRegistration, 123 __in BURN_REGISTRATION* pRegistration,
124 __in BURN_CACHE* pCache,
123 __in IXMLDOMNode* pixnBundle 125 __in IXMLDOMNode* pixnBundle
124 ) 126 )
125{ 127{
@@ -335,7 +337,7 @@ extern "C" HRESULT RegistrationParseFromXml(
335 ExitOnFailure(hr, "Failed to get @Classification."); 337 ExitOnFailure(hr, "Failed to get @Classification.");
336 } 338 }
337 339
338 hr = SetPaths(pRegistration); 340 hr = SetPaths(pRegistration, pCache);
339 ExitOnFailure(hr, "Failed to set registration paths."); 341 ExitOnFailure(hr, "Failed to set registration paths.");
340 342
341LExit: 343LExit:
@@ -614,6 +616,7 @@ LExit:
614extern "C" HRESULT RegistrationSessionBegin( 616extern "C" HRESULT RegistrationSessionBegin(
615 __in_z LPCWSTR wzEngineWorkingPath, 617 __in_z LPCWSTR wzEngineWorkingPath,
616 __in BURN_REGISTRATION* pRegistration, 618 __in BURN_REGISTRATION* pRegistration,
619 __in BURN_CACHE* pCache,
617 __in BURN_VARIABLES* pVariables, 620 __in BURN_VARIABLES* pVariables,
618 __in DWORD dwRegistrationOptions, 621 __in DWORD dwRegistrationOptions,
619 __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction, 622 __in BURN_DEPENDENCY_REGISTRATION_ACTION dependencyRegistrationAction,
@@ -633,7 +636,7 @@ extern "C" HRESULT RegistrationSessionBegin(
633 // Cache bundle executable. 636 // Cache bundle executable.
634 if (dwRegistrationOptions & BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE) 637 if (dwRegistrationOptions & BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE)
635 { 638 {
636 hr = CacheCompleteBundle(pRegistration->fPerMachine, pRegistration->sczExecutableName, pRegistration->sczId, wzEngineWorkingPath 639 hr = CacheCompleteBundle(pCache, pRegistration->fPerMachine, pRegistration->sczExecutableName, pRegistration->sczId, wzEngineWorkingPath
637#ifdef DEBUG 640#ifdef DEBUG
638 , pRegistration->sczCacheExecutablePath 641 , pRegistration->sczCacheExecutablePath
639#endif 642#endif
@@ -900,6 +903,7 @@ LExit:
900 *******************************************************************/ 903 *******************************************************************/
901extern "C" HRESULT RegistrationSessionEnd( 904extern "C" HRESULT RegistrationSessionEnd(
902 __in BURN_REGISTRATION* pRegistration, 905 __in BURN_REGISTRATION* pRegistration,
906 __in BURN_CACHE* pCache,
903 __in BURN_VARIABLES* pVariables, 907 __in BURN_VARIABLES* pVariables,
904 __in BURN_PACKAGES* pPackages, 908 __in BURN_PACKAGES* pPackages,
905 __in BURN_RESUME_MODE resumeMode, 909 __in BURN_RESUME_MODE resumeMode,
@@ -964,7 +968,7 @@ extern "C" HRESULT RegistrationSessionEnd(
964 ExitOnFailure(hr, "Failed to delete registration key: %ls", pRegistration->sczRegistrationKey); 968 ExitOnFailure(hr, "Failed to delete registration key: %ls", pRegistration->sczRegistrationKey);
965 } 969 }
966 970
967 CacheRemoveBundle(pRegistration->fPerMachine, pRegistration->sczId); 971 CacheRemoveBundle(pCache, pRegistration->fPerMachine, pRegistration->sczId);
968 } 972 }
969 else // the mode needs to be updated so open the registration key. 973 else // the mode needs to be updated so open the registration key.
970 { 974 {
@@ -1213,7 +1217,8 @@ LExit:
1213} 1217}
1214 1218
1215static HRESULT SetPaths( 1219static HRESULT SetPaths(
1216 __in BURN_REGISTRATION* pRegistration 1220 __in BURN_REGISTRATION* pRegistration,
1221 __in BURN_CACHE* pCache
1217 ) 1222 )
1218{ 1223{
1219 HRESULT hr = S_OK; 1224 HRESULT hr = S_OK;
@@ -1227,7 +1232,7 @@ static HRESULT SetPaths(
1227 ExitOnFailure(hr, "Failed to build uninstall registry key path."); 1232 ExitOnFailure(hr, "Failed to build uninstall registry key path.");
1228 1233
1229 // build cache directory 1234 // build cache directory
1230 hr = CacheGetCompletedPath(pRegistration->fPerMachine, pRegistration->sczId, &sczCacheDirectory); 1235 hr = CacheGetCompletedPath(pCache, pRegistration->fPerMachine, pRegistration->sczId, &sczCacheDirectory);
1231 ExitOnFailure(hr, "Failed to build cache directory."); 1236 ExitOnFailure(hr, "Failed to build cache directory.");
1232 1237
1233 // build cached executable path 1238 // build cached executable path