diff --git a/dev/Common/WindowsAppRuntimeAutoInitializer.cpp b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp index 543e7348e4..7e5abcafb9 100644 --- a/dev/Common/WindowsAppRuntimeAutoInitializer.cpp +++ b/dev/Common/WindowsAppRuntimeAutoInitializer.cpp @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation and Contributors. // Licensed under the MIT License. See LICENSE in the project root for license information. +#include + // Forward-declare the various AutoInitialize functions namespace Microsoft::Windows::ApplicationModel::DynamicDependency::Bootstrap { diff --git a/dev/Deployment/DeploymentActivityContext.cpp b/dev/Deployment/DeploymentActivityContext.cpp index 73111979d0..68b9dab6d6 100644 --- a/dev/Deployment/DeploymentActivityContext.cpp +++ b/dev/Deployment/DeploymentActivityContext.cpp @@ -37,7 +37,7 @@ void WindowsAppRuntime::Deployment::Activity::Context::SetLastFailure(const wil: if (failure.pszFile) { - m_lastFailure.file = *failure.pszFile; + m_lastFailure.file = failure.pszFile; } else { @@ -48,7 +48,7 @@ void WindowsAppRuntime::Deployment::Activity::Context::SetLastFailure(const wil: if (failure.pszMessage) { - m_lastFailure.message = *failure.pszMessage; + m_lastFailure.message = failure.pszMessage; } else { @@ -57,7 +57,7 @@ void WindowsAppRuntime::Deployment::Activity::Context::SetLastFailure(const wil: if (failure.pszModule) { - m_lastFailure.module = *failure.pszModule; + m_lastFailure.module = failure.pszModule; } else { diff --git a/dev/Deployment/DeploymentManager.cpp b/dev/Deployment/DeploymentManager.cpp index a342ad5757..c5ed308742 100644 --- a/dev/Deployment/DeploymentManager.cpp +++ b/dev/Deployment/DeploymentManager.cpp @@ -232,9 +232,9 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem { deploymentResult = _Initialize(initializeActivityContext, packageFullName, deploymentInitializeOptions, isRepair); } - catch (winrt::hresult_error const& e) + catch (...) { - const HRESULT hr{ e.code() }; + const HRESULT hr{ wil::ResultFromCaughtException() }; auto packageIdentity{ AppModel::Identity::PackageIdentity::FromPackageFullName(packageFullName.c_str()) }; PCWSTR c_packageNamePrefix{ L"microsoft.windowsappruntime." }; @@ -242,7 +242,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem std::wstring release; if (CompareStringOrdinal(packageIdentity.Name(), -1, c_packageNamePrefix, -1, TRUE) == CSTR_EQUAL) { - release = packageIdentity.Name() + c_packageNamePrefixLength; + release = packageIdentity.Name() + c_packageNamePrefixLength; } else { @@ -265,7 +265,7 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem THROW_HR_MSG(hr, "PackageFullName=%ls Options: ForceDeployment=%c OnErrorShowUI=%c isRepair:%c", packageFullName.c_str(), deploymentInitializeOptions.ForceDeployment() ? 'Y' : 'N', - deploymentInitializeOptions.OnErrorShowUI() ? 'Y' : 'N', isRepair ? 'Y' : 'N' ); + deploymentInitializeOptions.OnErrorShowUI() ? 'Y' : 'N', isRepair ? 'Y' : 'N'); } // Success! diff --git a/dev/Deployment/DeploymentManagerAutoInitializer.cpp b/dev/Deployment/DeploymentManagerAutoInitializer.cpp index 07a3bcaf7e..7840fe2bbb 100644 --- a/dev/Deployment/DeploymentManagerAutoInitializer.cpp +++ b/dev/Deployment/DeploymentManagerAutoInitializer.cpp @@ -4,6 +4,8 @@ #include #include +#include + #include #include diff --git a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp index 2ca590db64..8f76e132e3 100644 --- a/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp +++ b/dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.cpp @@ -4,6 +4,8 @@ #include #include +#include + // Ensure the including PE file has an import reference to // the WindowsAppSDK runtime DLL and thus gets loaded when // the including PE file gets loaded. diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapActivity.cpp b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapActivity.cpp index 219a015335..8d4faebdab 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapActivity.cpp +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapActivity.cpp @@ -18,7 +18,7 @@ void WindowsAppRuntime::MddBootstrap::Activity::Context::SetLastFailure(const wi if (failure.pszFile) { - m_lastFailure.file = *failure.pszFile; + m_lastFailure.file = failure.pszFile; } else { @@ -29,7 +29,7 @@ void WindowsAppRuntime::MddBootstrap::Activity::Context::SetLastFailure(const wi if (failure.pszMessage) { - m_lastFailure.message = *failure.pszMessage; + m_lastFailure.message = failure.pszMessage; } else { @@ -38,7 +38,7 @@ void WindowsAppRuntime::MddBootstrap::Activity::Context::SetLastFailure(const wi if (failure.pszModule) { - m_lastFailure.module = *failure.pszModule; + m_lastFailure.module = failure.pszModule; } else { diff --git a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp index f2aa32d42a..fb163c1947 100644 --- a/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp +++ b/dev/WindowsAppRuntime_BootstrapDLL/MddBootstrapAutoInitializer.cpp @@ -4,6 +4,9 @@ #include #include #include + +#include + #include #include diff --git a/installer/dev/InstallActivityContext.cpp b/installer/dev/InstallActivityContext.cpp index 567098b528..10f091211f 100644 --- a/installer/dev/InstallActivityContext.cpp +++ b/installer/dev/InstallActivityContext.cpp @@ -37,7 +37,7 @@ void WindowsAppRuntimeInstaller::InstallActivity::Context::SetLastFailure(const if (failure.pszFile) { - m_lastFailure.file = *failure.pszFile; + m_lastFailure.file = failure.pszFile; } else { @@ -48,7 +48,7 @@ void WindowsAppRuntimeInstaller::InstallActivity::Context::SetLastFailure(const if (failure.pszMessage) { - m_lastFailure.message = *failure.pszMessage; + m_lastFailure.message = failure.pszMessage; } else {