From ad5aeb25c459196938cc88c404406bbbe1df9061 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 12 Apr 2021 14:17:41 -0700 Subject: Port support for ISO/IEC 19770-2:2105 (aka SWID Tags-2) Fixes wixtoolset/issues#8380 --- src/engine/apply.cpp | 2 +- src/engine/elevation.cpp | 6 ++-- src/engine/engine.vcxproj | 4 +-- src/engine/packages.config | 2 +- src/engine/registration.cpp | 56 +++++++++++++++++------------- src/engine/registration.h | 2 ++ src/stub/packages.config | 2 +- src/stub/stub.vcxproj | 4 +-- src/test/BurnUnitTest/BurnUnitTest.vcxproj | 4 +-- src/test/BurnUnitTest/RegistrationTest.cpp | 22 ++++++------ src/test/BurnUnitTest/VariableTest.cpp | 6 ++-- src/test/BurnUnitTest/packages.config | 2 +- 12 files changed, 61 insertions(+), 51 deletions(-) diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index 77080c76..dc40c50d 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp @@ -435,7 +435,7 @@ extern "C" HRESULT ApplyUnregister( } else { - hr = RegistrationSessionEnd(&pEngineState->registration, &pEngineState->packages, resumeMode, restart, pEngineState->plan.dependencyRegistrationAction); + hr = RegistrationSessionEnd(&pEngineState->registration, &pEngineState->variables, &pEngineState->packages, resumeMode, restart, pEngineState->plan.dependencyRegistrationAction); ExitOnFailure(hr, "Failed to end session in per-user process."); } diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index 1737bf5b..82d5a9b1 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp @@ -156,6 +156,7 @@ static HRESULT OnSessionResume( static HRESULT OnSessionEnd( __in BURN_PACKAGES* pPackages, __in BURN_REGISTRATION* pRegistration, + __in BURN_VARIABLES* pVariables, __in BYTE* pbData, __in DWORD cbData ); @@ -1650,7 +1651,7 @@ static HRESULT ProcessElevatedChildMessage( break; case BURN_ELEVATION_MESSAGE_TYPE_SESSION_END: - hrResult = OnSessionEnd(pContext->pPackages, pContext->pRegistration, (BYTE*)pMsg->pvData, pMsg->cbData); + hrResult = OnSessionEnd(pContext->pPackages, pContext->pRegistration, pContext->pVariables, (BYTE*)pMsg->pvData, pMsg->cbData); break; case BURN_ELEVATION_MESSAGE_TYPE_SAVE_STATE: @@ -1969,6 +1970,7 @@ LExit: static HRESULT OnSessionEnd( __in BURN_PACKAGES* pPackages, __in BURN_REGISTRATION* pRegistration, + __in BURN_VARIABLES* pVariables, __in BYTE* pbData, __in DWORD cbData ) @@ -1990,7 +1992,7 @@ static HRESULT OnSessionEnd( ExitOnFailure(hr, "Failed to read dependency registration action."); // suspend session in per-machine process - hr = RegistrationSessionEnd(pRegistration, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction); + hr = RegistrationSessionEnd(pRegistration, pVariables, pPackages, (BURN_RESUME_MODE)dwResumeMode, (BOOTSTRAPPER_APPLY_RESTART)dwRestart, (BURN_DEPENDENCY_REGISTRATION_ACTION)dwDependencyRegistrationAction); ExitOnFailure(hr, "Failed to suspend registration session."); LExit: diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index e418e6f4..666b3f37 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj @@ -1,7 +1,7 @@ - + Debug @@ -165,7 +165,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}. - + \ No newline at end of file diff --git a/src/engine/packages.config b/src/engine/packages.config index 84e3078b..1d09f0a7 100644 --- a/src/engine/packages.config +++ b/src/engine/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/src/engine/registration.cpp b/src/engine/registration.cpp index fc5ae627..b8a2283f 100644 --- a/src/engine/registration.cpp +++ b/src/engine/registration.cpp @@ -31,6 +31,7 @@ const LPCWSTR REGISTRY_BUNDLE_UNINSTALL_STRING = L"UninstallString"; const LPCWSTR REGISTRY_BUNDLE_RESUME_COMMAND_LINE = L"BundleResumeCommandLine"; const LPCWSTR REGISTRY_BUNDLE_VERSION_MAJOR = L"VersionMajor"; const LPCWSTR REGISTRY_BUNDLE_VERSION_MINOR = L"VersionMinor"; +const LPCWSTR SWIDTAG_FOLDER = L"swidtag"; // internal function declarations @@ -67,11 +68,11 @@ static HRESULT FormatUpdateRegistrationKey( __out_z LPWSTR* psczKey ); static HRESULT WriteSoftwareTags( - __in BOOL fPerMachine, + __in BURN_VARIABLES* pVariables, __in BURN_SOFTWARE_TAGS* pSoftwareTags ); static HRESULT RemoveSoftwareTags( - __in BOOL fPerMachine, + __in BURN_VARIABLES* pVariables, __in BURN_SOFTWARE_TAGS* pSoftwareTags ); static HRESULT WriteUpdateRegistration( @@ -392,6 +393,7 @@ extern "C" void RegistrationUninitialize( { ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczFilename); ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczRegid); + ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczPath); ReleaseStr(pRegistration->softwareTags.rgSoftwareTags[i].sczTag); } @@ -778,7 +780,7 @@ extern "C" HRESULT RegistrationSessionBegin( if (pRegistration->softwareTags.cSoftwareTags) { - hr = WriteSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags); + hr = WriteSoftwareTags(pVariables, &pRegistration->softwareTags); ExitOnFailure(hr, "Failed to write software tags."); } @@ -867,6 +869,7 @@ LExit: *******************************************************************/ extern "C" HRESULT RegistrationSessionEnd( __in BURN_REGISTRATION* pRegistration, + __in BURN_VARIABLES* pVariables, __in BURN_PACKAGES* pPackages, __in BURN_RESUME_MODE resumeMode, __in BOOTSTRAPPER_APPLY_RESTART restart, @@ -920,7 +923,7 @@ extern "C" HRESULT RegistrationSessionEnd( RemoveUpdateRegistration(pRegistration); } - RemoveSoftwareTags(pRegistration->fPerMachine, &pRegistration->softwareTags); + RemoveSoftwareTags(pVariables, &pRegistration->softwareTags); // Delete registration key. hr = RegDelete(pRegistration->hkRoot, pRegistration->sczRegistrationKey, REG_KEY_DEFAULT, FALSE); @@ -1063,6 +1066,9 @@ static HRESULT ParseSoftwareTagsFromXml( hr = XmlGetAttributeEx(pixnNode, L"Regid", &pSoftwareTag->sczRegid); ExitOnFailure(hr, "Failed to get @Regid."); + hr = XmlGetAttributeEx(pixnNode, L"Path", &pSoftwareTag->sczPath); + ExitOnFailure(hr, "Failed to get @Path."); + hr = XmlGetText(pixnNode, &bstrTagXml); ExitOnFailure(hr, "Failed to get SoftwareTag text."); @@ -1370,30 +1376,30 @@ LExit: } static HRESULT WriteSoftwareTags( - __in BOOL fPerMachine, + __in BURN_VARIABLES* pVariables, __in BURN_SOFTWARE_TAGS* pSoftwareTags ) { HRESULT hr = S_OK; LPWSTR sczRootFolder = NULL; - LPWSTR sczRegidFolder = NULL; + LPWSTR sczTagFolder = NULL; LPWSTR sczPath = NULL; - hr = PathGetKnownFolder(fPerMachine ? CSIDL_COMMON_APPDATA : CSIDL_LOCAL_APPDATA, &sczRootFolder); - ExitOnFailure(hr, "Failed to find local %hs appdata directory.", fPerMachine ? "per-machine" : "per-user"); - for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) { BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; - hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder); - ExitOnFailure(hr, "Failed to allocate regid folder path."); + hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL); + ExitOnFailure(hr, "Failed to format tag folder path."); - hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath); + hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder); ExitOnFailure(hr, "Failed to allocate regid folder path."); - hr = DirEnsureExists(sczRegidFolder, NULL); - ExitOnFailure(hr, "Failed to create regid folder: %ls", sczRegidFolder); + hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath); + ExitOnFailure(hr, "Failed to allocate regid file path."); + + hr = DirEnsureExists(sczTagFolder, NULL); + ExitOnFailure(hr, "Failed to create regid folder: %ls", sczTagFolder); hr = FileWrite(sczPath, FILE_ATTRIBUTE_NORMAL, reinterpret_cast(pSoftwareTag->sczTag), lstrlenA(pSoftwareTag->sczTag), NULL); ExitOnFailure(hr, "Failed to write tag xml to file: %ls", sczPath); @@ -1401,44 +1407,44 @@ static HRESULT WriteSoftwareTags( LExit: ReleaseStr(sczPath); - ReleaseStr(sczRegidFolder); + ReleaseStr(sczTagFolder); ReleaseStr(sczRootFolder); return hr; } static HRESULT RemoveSoftwareTags( - __in BOOL fPerMachine, + __in BURN_VARIABLES* pVariables, __in BURN_SOFTWARE_TAGS* pSoftwareTags ) { HRESULT hr = S_OK; LPWSTR sczRootFolder = NULL; - LPWSTR sczRegidFolder = NULL; + LPWSTR sczTagFolder = NULL; LPWSTR sczPath = NULL; - hr = PathGetKnownFolder(fPerMachine ? CSIDL_COMMON_APPDATA : CSIDL_LOCAL_APPDATA, &sczRootFolder); - ExitOnFailure(hr, "Failed to find local %hs appdata directory.", fPerMachine ? "per-machine" : "per-user"); - for (DWORD iTag = 0; iTag < pSoftwareTags->cSoftwareTags; ++iTag) { BURN_SOFTWARE_TAG* pSoftwareTag = pSoftwareTags->rgSoftwareTags + iTag; - hr = PathConcat(sczRootFolder, pSoftwareTag->sczRegid, &sczRegidFolder); - ExitOnFailure(hr, "Failed to allocate regid folder path."); + hr = VariableFormatString(pVariables, pSoftwareTag->sczPath, &sczRootFolder, NULL); + ExitOnFailure(hr, "Failed to format tag folder path."); - hr = PathConcat(sczRegidFolder, pSoftwareTag->sczFilename, &sczPath); + hr = PathConcat(sczRootFolder, SWIDTAG_FOLDER, &sczTagFolder); ExitOnFailure(hr, "Failed to allocate regid folder path."); + hr = PathConcat(sczTagFolder, pSoftwareTag->sczFilename, &sczPath); + ExitOnFailure(hr, "Failed to allocate regid file path."); + // Best effort to delete the software tag file and the regid folder. FileEnsureDelete(sczPath); - ::RemoveDirectoryW(sczRegidFolder); + DirDeleteEmptyDirectoriesToRoot(sczTagFolder, 0); } LExit: ReleaseStr(sczPath); - ReleaseStr(sczRegidFolder); + ReleaseStr(sczTagFolder); ReleaseStr(sczRootFolder); return hr; diff --git a/src/engine/registration.h b/src/engine/registration.h index 39fee65f..ed0641eb 100644 --- a/src/engine/registration.h +++ b/src/engine/registration.h @@ -77,6 +77,7 @@ typedef struct _BURN_SOFTWARE_TAG { LPWSTR sczFilename; LPWSTR sczRegid; + LPWSTR sczPath; LPSTR sczTag; } BURN_SOFTWARE_TAG; @@ -198,6 +199,7 @@ HRESULT RegistrationSessionResume( ); HRESULT RegistrationSessionEnd( __in BURN_REGISTRATION* pRegistration, + __in BURN_VARIABLES* pVariables, __in BURN_PACKAGES* pPackages, __in BURN_RESUME_MODE resumeMode, __in BOOTSTRAPPER_APPLY_RESTART restart, diff --git a/src/stub/packages.config b/src/stub/packages.config index 44bf19aa..eb05a40b 100644 --- a/src/stub/packages.config +++ b/src/stub/packages.config @@ -4,5 +4,5 @@ - + \ No newline at end of file diff --git a/src/stub/stub.vcxproj b/src/stub/stub.vcxproj index f235a1fd..ae9c21df 100644 --- a/src/stub/stub.vcxproj +++ b/src/stub/stub.vcxproj @@ -5,7 +5,7 @@ - + @@ -117,6 +117,6 @@ - + \ No newline at end of file diff --git a/src/test/BurnUnitTest/BurnUnitTest.vcxproj b/src/test/BurnUnitTest/BurnUnitTest.vcxproj index 529ab727..b57ebb16 100644 --- a/src/test/BurnUnitTest/BurnUnitTest.vcxproj +++ b/src/test/BurnUnitTest/BurnUnitTest.vcxproj @@ -4,7 +4,7 @@ - + Debug @@ -97,6 +97,6 @@ - + \ No newline at end of file diff --git a/src/test/BurnUnitTest/RegistrationTest.cpp b/src/test/BurnUnitTest/RegistrationTest.cpp index 883a1258..2cb66c3f 100644 --- a/src/test/BurnUnitTest/RegistrationTest.cpp +++ b/src/test/BurnUnitTest/RegistrationTest.cpp @@ -123,7 +123,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)(Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr))); // end session - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration was removed @@ -213,7 +213,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // complete registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration was updated @@ -235,7 +235,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // delete registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration was removed @@ -324,7 +324,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // complete registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_REQUIRED, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration variables were updated @@ -344,7 +344,7 @@ namespace Bootstrapper // // delete registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration was removed @@ -435,7 +435,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // finish registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_ARP, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); TestThrowOnFailure(hr, L"Failed to register bundle."); // verify that registration was updated @@ -468,7 +468,7 @@ namespace Bootstrapper Assert::Equal(String::Concat(L"\"", Path::Combine(cacheDirectory, gcnew String(L"setup.exe")), L"\" /burn.runonce"), (String^)Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // delete registration - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // verify that registration was removed @@ -509,7 +509,7 @@ namespace Bootstrapper BYTE rgbData[256] = { }; BOOTSTRAPPER_RESUME_TYPE resumeType = BOOTSTRAPPER_RESUME_TYPE_NONE; BYTE* pbBuffer = NULL; - DWORD cbBuffer = 0; + SIZE_T cbBuffer = 0; String^ cacheDirectory = Path::Combine(Path::Combine(Environment::GetFolderPath(Environment::SpecialFolder::LocalApplicationData), gcnew String(L"Package Cache")), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}")); try { @@ -573,7 +573,7 @@ namespace Bootstrapper Assert::Equal((int)BOOTSTRAPPER_RESUME_TYPE_INTERRUPTED, (int)resumeType); // suspend session - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_SUSPEND, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_REGISTER); TestThrowOnFailure(hr, L"Failed to suspend session."); // verify that run key was removed @@ -589,7 +589,7 @@ namespace Bootstrapper hr = RegistrationLoadState(®istration, &pbBuffer, &cbBuffer); TestThrowOnFailure(hr, L"Failed to load state."); - Assert::Equal((DWORD)sizeof(rgbData), cbBuffer); + Assert::Equal((SIZE_T)sizeof(rgbData), cbBuffer); Assert::True(0 == memcmp(pbBuffer, rgbData, sizeof(rgbData))); // write active resume mode @@ -600,7 +600,7 @@ namespace Bootstrapper Assert::NotEqual((Object^)nullptr, Registry::GetValue(gcnew String(TEST_RUN_KEY), gcnew String(L"{D54F896D-1952-43e6-9C67-B5652240618C}"), nullptr)); // end session - hr = RegistrationSessionEnd(®istration, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); + hr = RegistrationSessionEnd(®istration, &variables, &packages, BURN_RESUME_MODE_NONE, BOOTSTRAPPER_APPLY_RESTART_NONE, BURN_DEPENDENCY_REGISTRATION_ACTION_UNREGISTER); TestThrowOnFailure(hr, L"Failed to unregister bundle."); // read resume type after session diff --git a/src/test/BurnUnitTest/VariableTest.cpp b/src/test/BurnUnitTest/VariableTest.cpp index ab45a73f..5c9dce03 100644 --- a/src/test/BurnUnitTest/VariableTest.cpp +++ b/src/test/BurnUnitTest/VariableTest.cpp @@ -134,7 +134,7 @@ namespace Bootstrapper HRESULT hr = S_OK; BURN_VARIABLES variables = { }; LPWSTR scz = NULL; - DWORD cch = 0; + SIZE_T cch = 0; BOOL fContainsHiddenData = FALSE; try { @@ -180,12 +180,12 @@ namespace Bootstrapper hr = VariableFormatString(&variables, L"PRE [PROP1] POST", &scz, &cch); TestThrowOnFailure(hr, L"Failed to format string"); - Assert::Equal((DWORD)lstrlenW(scz), cch); + Assert::Equal((SIZE_T)lstrlenW(scz), cch); hr = VariableFormatString(&variables, L"PRE [PROP1] POST", NULL, &cch); TestThrowOnFailure(hr, L"Failed to format string"); - Assert::Equal((DWORD)lstrlenW(scz), cch); + Assert::Equal((SIZE_T)lstrlenW(scz), cch); } finally { diff --git a/src/test/BurnUnitTest/packages.config b/src/test/BurnUnitTest/packages.config index accce624..a7b88aa1 100644 --- a/src/test/BurnUnitTest/packages.config +++ b/src/test/BurnUnitTest/packages.config @@ -10,5 +10,5 @@ - + \ No newline at end of file -- cgit v1.2.3-55-g6feb