From 8887adcb263bbd5308666c1d2019592830852847 Mon Sep 17 00:00:00 2001 From: agniuks Date: Tue, 24 Mar 2026 10:26:48 -0700 Subject: [PATCH 1/5] Add IsPackagedProcess and IsSelfContained to common insights PartB fields --- .../AppModel.Identity.IsPackagedProcess.h | 30 +++++++++ dev/Common/AppModel.Identity.h | 9 +-- dev/Common/Common.vcxitems | 1 + dev/Common/Common.vcxitems.filters | 3 + dev/Common/WindowsAppRuntime.SelfContained.h | 17 ++++++ dev/MRTCore/mrt/Core/src/MRM.vcxproj | 2 +- .../mrm/UnitTests/MrmBaseUnitTests.vcxproj | 4 +- dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj | 2 +- dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj | 2 +- .../PushNotificationsLongRunningTask.vcxproj | 12 ++-- .../WindowsAppRuntimeInsights.h | 61 ++++++++++++++++++- 11 files changed, 124 insertions(+), 19 deletions(-) create mode 100644 dev/Common/AppModel.Identity.IsPackagedProcess.h diff --git a/dev/Common/AppModel.Identity.IsPackagedProcess.h b/dev/Common/AppModel.Identity.IsPackagedProcess.h new file mode 100644 index 0000000000..3feb0d6a42 --- /dev/null +++ b/dev/Common/AppModel.Identity.IsPackagedProcess.h @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation and Contributors. +// Licensed under the MIT License. + +#ifndef __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H +#define __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H + +#include + +namespace AppModel::Identity +{ +inline HRESULT IsPackagedProcess_nothrow(bool& isPackagedProcess) noexcept +{ + isPackagedProcess = false; + UINT32 n{}; + const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; + RETURN_HR_IF(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER)); + isPackagedProcess = (rc == ERROR_INSUFFICIENT_BUFFER); + return S_OK; +} + +inline bool IsPackagedProcess() +{ + UINT32 n{}; + const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; + THROW_HR_IF_MSG(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER), "GetCurrentPackageFullName rc=%d", rc); + return rc == ERROR_INSUFFICIENT_BUFFER; +} +} + +#endif // __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H diff --git a/dev/Common/AppModel.Identity.h b/dev/Common/AppModel.Identity.h index 25392bc3fe..5ba93d56bd 100644 --- a/dev/Common/AppModel.Identity.h +++ b/dev/Common/AppModel.Identity.h @@ -9,15 +9,10 @@ #include #include +#include "AppModel.Identity.IsPackagedProcess.h" + namespace AppModel::Identity { -inline bool IsPackagedProcess() -{ - UINT32 n{}; - const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; - THROW_HR_IF_MSG(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER), "GetCurrentPackageFullName rc=%d", rc); - return rc == ERROR_INSUFFICIENT_BUFFER; -} template inline Tstring GetCurrentPackageFullName() diff --git a/dev/Common/Common.vcxitems b/dev/Common/Common.vcxitems index 6b554ac6f2..0da4fd227a 100644 --- a/dev/Common/Common.vcxitems +++ b/dev/Common/Common.vcxitems @@ -20,6 +20,7 @@ + diff --git a/dev/Common/Common.vcxitems.filters b/dev/Common/Common.vcxitems.filters index cff6f33620..987c2340a5 100644 --- a/dev/Common/Common.vcxitems.filters +++ b/dev/Common/Common.vcxitems.filters @@ -14,6 +14,9 @@ Header Files + + Header Files + Header Files diff --git a/dev/Common/WindowsAppRuntime.SelfContained.h b/dev/Common/WindowsAppRuntime.SelfContained.h index 52d1da0081..6bb64c80ba 100644 --- a/dev/Common/WindowsAppRuntime.SelfContained.h +++ b/dev/Common/WindowsAppRuntime.SelfContained.h @@ -20,6 +20,23 @@ inline bool IsSelfContained() THROW_IF_FAILED(WindowsAppRuntime_IsSelfContained(&isSelfContained)); return !!isSelfContained; } + +/// Non-throwing variant using dynamic loading (safe before DLL is loaded). +inline HRESULT IsSelfContained_nothrow(bool& isSelfContained) noexcept +{ + isSelfContained = false; + auto module = ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll"); + RETURN_LAST_ERROR_IF_NULL(module); + using IsSelfContainedFn = HRESULT(__stdcall*)(BOOL*); + auto fn = reinterpret_cast( + ::GetProcAddress(module, "WindowsAppRuntime_IsSelfContained")); + RETURN_LAST_ERROR_IF_NULL(fn); + BOOL result{}; + const auto hr{ fn(&result) }; + RETURN_IF_FAILED(hr); + isSelfContained = !!result; + return S_OK; +} } #endif // defined(__cplusplus) diff --git a/dev/MRTCore/mrt/Core/src/MRM.vcxproj b/dev/MRTCore/mrt/Core/src/MRM.vcxproj index 1a4f3740b0..0be23543d2 100644 --- a/dev/MRTCore/mrt/Core/src/MRM.vcxproj +++ b/dev/MRTCore/mrt/Core/src/MRM.vcxproj @@ -67,7 +67,7 @@ WIN32;_WINDOWS;_USRDLL;UNICODE;_UNICODE;%(PreprocessorDefinitions) true - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include $(OutDir)..\mrmmin\mrmmin.lib;rpcrt4.lib;onecoreuap.lib;%(AdditionalDependencies) diff --git a/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj b/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj index 1f34a069e9..c36111d20e 100644 --- a/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj +++ b/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj @@ -91,13 +91,13 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) 4309;4838;%(DisableSpecificWarnings) - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) 4309;4838;%(DisableSpecificWarnings) diff --git a/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj b/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj index 91f861c2f9..8c8948b17e 100644 --- a/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj +++ b/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj @@ -107,7 +107,7 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include diff --git a/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj b/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj index 9af96e4e4e..624c5bec21 100644 --- a/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj +++ b/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj @@ -111,7 +111,7 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include diff --git a/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj b/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj index 5ede563b65..f0aaf22aad 100644 --- a/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj +++ b/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj @@ -102,7 +102,7 @@ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -112,7 +112,7 @@ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -122,7 +122,7 @@ _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -132,7 +132,7 @@ NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -143,7 +143,7 @@ _DEBUG;_WINDOWS;%(PreprocessorDefinitions) stdcpp20 - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -154,7 +154,7 @@ NDEBUG;_WINDOWS;%(PreprocessorDefinitions) stdcpp20 - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows diff --git a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h index 3d5930af36..7315fb6768 100644 --- a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h +++ b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h @@ -13,8 +13,18 @@ #include #include +#include namespace Microsoft::WindowsAppRuntime::Insights { + enum class TraceLoggingInformationFlags : std::uint32_t + { + None = 0, + IsDebuggerPresent = 0x00000001, + IsPackagedProcess = 0x00000002, + IsSelfContained = 0x00000004, + }; + DEFINE_ENUM_FLAG_OPERATORS(TraceLoggingInformationFlags) + class RuntimeInformation { public: @@ -32,6 +42,55 @@ return channel; } + // Inlined from the canonical implementations (see for reference): + // IsPackagedProcess: dev/Common/AppModel.Identity.IsPackagedProcess.h + // IsSelfContained: dev/Common/WindowsAppRuntime.SelfContained.h / .cpp + // Duplicated here to avoid exposing those headers as public API. + static std::uint32_t TraceLoggingInformationFlags() + { + static std::uint32_t flags{ []() -> std::uint32_t { + auto f{ Insights::TraceLoggingInformationFlags::None }; + + if (wil::details::IsDebuggerPresent()) + { + f |= Insights::TraceLoggingInformationFlags::IsDebuggerPresent; + } + + { + UINT32 n{}; + const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; + if ((rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER)) + { + LOG_HR(HRESULT_FROM_WIN32(rc)); + } + else if (rc == ERROR_INSUFFICIENT_BUFFER) + { + f |= Insights::TraceLoggingInformationFlags::IsPackagedProcess; + } + } + + { + auto module{ ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll") }; + if (module) + { + using IsSelfContainedFn = HRESULT(__stdcall*)(BOOL*); + auto fn{ reinterpret_cast(::GetProcAddress(module, "WindowsAppRuntime_IsSelfContained")) }; + if (fn) + { + BOOL result{}; + if (SUCCEEDED_LOG(fn(&result)) && result) + { + f |= Insights::TraceLoggingInformationFlags::IsSelfContained; + } + } + } + } + + return static_cast(f); + }() }; + return flags; + } + private: static std::string LoadStringFromResource(uint32_t id) { @@ -60,7 +119,7 @@ TraceLoggingStruct(4, "COMMON_WINDOWSAPPSDK_PARAMS"), \ TraceLoggingString(::Microsoft::WindowsAppRuntime::Insights::RuntimeInformation::WindowsAppRuntimeVersion().c_str(), "Version"), \ TraceLoggingString(::Microsoft::WindowsAppRuntime::Insights::RuntimeInformation::WindowsAppRuntimeChannel().c_str(), "WindowsAppSDKChannel"), \ - TraceLoggingBool(wil::details::IsDebuggerPresent(), "IsDebugging"), \ + TraceLoggingUInt32(::Microsoft::WindowsAppRuntime::Insights::RuntimeInformation::TraceLoggingInformationFlags(), "Flags"), \ TraceLoggingBool(true, "UTCReplace_AppSessionGuid") #include From 232341c1b989dc7238b9eaf85d5dd4f3e12e3171 Mon Sep 17 00:00:00 2001 From: agniuks Date: Tue, 24 Mar 2026 10:48:25 -0700 Subject: [PATCH 2/5] containment --- .../RuntimeCompatibilityOptions.idl | 1 + .../WindowsAppRuntimeInsights.h | 43 +++++++++++-------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl index fef275fc8f..3039b18d83 100644 --- a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl +++ b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl @@ -34,6 +34,7 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime AppLifecycle_SharedMemoryRedirectionQueueFix = 60972838, SplitMenuFlyoutItem_Available = 60878987, TextIntelligence_Insights = 61106039, + RuntimeInformation_PartBInsightsFlags = 61555948, }; /// Represents a version of the Windows App Runtime. diff --git a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h index 7315fb6768..368fbe000d 100644 --- a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h +++ b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h @@ -14,6 +14,10 @@ #include #include #include +#include + +// Bug 61555948: [1.8.6 servicing] RuntimeInformation_PartBInsightsFlags - Add IsPackagedProcess and IsSelfContained to common insights PartB fields +#define WINAPPSDK_CHANGEID_61555948 61555948, WinAppSDK_1_8_6 namespace Microsoft::WindowsAppRuntime::Insights { enum class TraceLoggingInformationFlags : std::uint32_t @@ -56,31 +60,34 @@ f |= Insights::TraceLoggingInformationFlags::IsDebuggerPresent; } + if (WinAppSdk::Containment::IsChangeEnabled()) { - UINT32 n{}; - const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; - if ((rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER)) - { - LOG_HR(HRESULT_FROM_WIN32(rc)); - } - else if (rc == ERROR_INSUFFICIENT_BUFFER) { - f |= Insights::TraceLoggingInformationFlags::IsPackagedProcess; + UINT32 n{}; + const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; + if ((rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER)) + { + LOG_HR(HRESULT_FROM_WIN32(rc)); + } + else if (rc == ERROR_INSUFFICIENT_BUFFER) + { + f |= Insights::TraceLoggingInformationFlags::IsPackagedProcess; + } } - } - { - auto module{ ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll") }; - if (module) { - using IsSelfContainedFn = HRESULT(__stdcall*)(BOOL*); - auto fn{ reinterpret_cast(::GetProcAddress(module, "WindowsAppRuntime_IsSelfContained")) }; - if (fn) + auto module{ ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll") }; + if (module) { - BOOL result{}; - if (SUCCEEDED_LOG(fn(&result)) && result) + using IsSelfContainedFn = HRESULT(__stdcall*)(BOOL*); + auto fn{ reinterpret_cast(::GetProcAddress(module, "WindowsAppRuntime_IsSelfContained")) }; + if (fn) { - f |= Insights::TraceLoggingInformationFlags::IsSelfContained; + BOOL result{}; + if (SUCCEEDED_LOG(fn(&result)) && result) + { + f |= Insights::TraceLoggingInformationFlags::IsSelfContained; + } } } } From 842c138fb616548680a2f516eb5664f017f010b7 Mon Sep 17 00:00:00 2001 From: agniuks Date: Tue, 24 Mar 2026 10:55:31 -0700 Subject: [PATCH 3/5] enum name change --- .../RuntimeCompatibilityOptions.idl | 4 +++- dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl index 3039b18d83..1f3fb13a78 100644 --- a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl +++ b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.idl @@ -34,7 +34,9 @@ namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime AppLifecycle_SharedMemoryRedirectionQueueFix = 60972838, SplitMenuFlyoutItem_Available = 60878987, TextIntelligence_Insights = 61106039, - RuntimeInformation_PartBInsightsFlags = 61555948, + + // 1.8.7 + AppRuntime_Insights = 61555948, }; /// Represents a version of the Windows App Runtime. diff --git a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h index 368fbe000d..78251a0ef7 100644 --- a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h +++ b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h @@ -16,8 +16,8 @@ #include #include -// Bug 61555948: [1.8.6 servicing] RuntimeInformation_PartBInsightsFlags - Add IsPackagedProcess and IsSelfContained to common insights PartB fields -#define WINAPPSDK_CHANGEID_61555948 61555948, WinAppSDK_1_8_6 +// Bug 61555948: [1.8.6 servicing] AppRuntime_Insights - Add IsPackagedProcess and IsSelfContained to common insights PartB fields +#define WINAPPSDK_CHANGEID_61555948 61555948, WinAppSDK_1_8_7 namespace Microsoft::WindowsAppRuntime::Insights { enum class TraceLoggingInformationFlags : std::uint32_t From 3c128557551f8b2d2a9aada1c80d4bdf7d078274 Mon Sep 17 00:00:00 2001 From: agniuks Date: Mon, 30 Mar 2026 14:38:50 -0700 Subject: [PATCH 4/5] cleanup --- .../AppModel.Identity.IsPackagedProcess.h | 30 ------------------- dev/Common/AppModel.Identity.h | 9 ++++-- dev/Common/Common.vcxitems | 1 - dev/Common/Common.vcxitems.filters | 3 -- dev/Common/WindowsAppRuntime.SelfContained.h | 17 ----------- dev/MRTCore/mrt/Core/src/MRM.vcxproj | 2 +- .../mrm/UnitTests/MrmBaseUnitTests.vcxproj | 4 +-- dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj | 2 +- dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj | 2 +- .../PushNotificationsLongRunningTask.vcxproj | 12 ++++---- 10 files changed, 18 insertions(+), 64 deletions(-) delete mode 100644 dev/Common/AppModel.Identity.IsPackagedProcess.h diff --git a/dev/Common/AppModel.Identity.IsPackagedProcess.h b/dev/Common/AppModel.Identity.IsPackagedProcess.h deleted file mode 100644 index 3feb0d6a42..0000000000 --- a/dev/Common/AppModel.Identity.IsPackagedProcess.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation and Contributors. -// Licensed under the MIT License. - -#ifndef __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H -#define __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H - -#include - -namespace AppModel::Identity -{ -inline HRESULT IsPackagedProcess_nothrow(bool& isPackagedProcess) noexcept -{ - isPackagedProcess = false; - UINT32 n{}; - const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; - RETURN_HR_IF(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER)); - isPackagedProcess = (rc == ERROR_INSUFFICIENT_BUFFER); - return S_OK; -} - -inline bool IsPackagedProcess() -{ - UINT32 n{}; - const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; - THROW_HR_IF_MSG(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER), "GetCurrentPackageFullName rc=%d", rc); - return rc == ERROR_INSUFFICIENT_BUFFER; -} -} - -#endif // __APPMODEL_IDENTITY_ISPACKAGEDPROCESS_H diff --git a/dev/Common/AppModel.Identity.h b/dev/Common/AppModel.Identity.h index 5ba93d56bd..25392bc3fe 100644 --- a/dev/Common/AppModel.Identity.h +++ b/dev/Common/AppModel.Identity.h @@ -9,10 +9,15 @@ #include #include -#include "AppModel.Identity.IsPackagedProcess.h" - namespace AppModel::Identity { +inline bool IsPackagedProcess() +{ + UINT32 n{}; + const auto rc{ ::GetCurrentPackageFullName(&n, nullptr) }; + THROW_HR_IF_MSG(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER), "GetCurrentPackageFullName rc=%d", rc); + return rc == ERROR_INSUFFICIENT_BUFFER; +} template inline Tstring GetCurrentPackageFullName() diff --git a/dev/Common/Common.vcxitems b/dev/Common/Common.vcxitems index 0da4fd227a..6b554ac6f2 100644 --- a/dev/Common/Common.vcxitems +++ b/dev/Common/Common.vcxitems @@ -20,7 +20,6 @@ - diff --git a/dev/Common/Common.vcxitems.filters b/dev/Common/Common.vcxitems.filters index 987c2340a5..cff6f33620 100644 --- a/dev/Common/Common.vcxitems.filters +++ b/dev/Common/Common.vcxitems.filters @@ -14,9 +14,6 @@ Header Files - - Header Files - Header Files diff --git a/dev/Common/WindowsAppRuntime.SelfContained.h b/dev/Common/WindowsAppRuntime.SelfContained.h index 6bb64c80ba..52d1da0081 100644 --- a/dev/Common/WindowsAppRuntime.SelfContained.h +++ b/dev/Common/WindowsAppRuntime.SelfContained.h @@ -20,23 +20,6 @@ inline bool IsSelfContained() THROW_IF_FAILED(WindowsAppRuntime_IsSelfContained(&isSelfContained)); return !!isSelfContained; } - -/// Non-throwing variant using dynamic loading (safe before DLL is loaded). -inline HRESULT IsSelfContained_nothrow(bool& isSelfContained) noexcept -{ - isSelfContained = false; - auto module = ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll"); - RETURN_LAST_ERROR_IF_NULL(module); - using IsSelfContainedFn = HRESULT(__stdcall*)(BOOL*); - auto fn = reinterpret_cast( - ::GetProcAddress(module, "WindowsAppRuntime_IsSelfContained")); - RETURN_LAST_ERROR_IF_NULL(fn); - BOOL result{}; - const auto hr{ fn(&result) }; - RETURN_IF_FAILED(hr); - isSelfContained = !!result; - return S_OK; -} } #endif // defined(__cplusplus) diff --git a/dev/MRTCore/mrt/Core/src/MRM.vcxproj b/dev/MRTCore/mrt/Core/src/MRM.vcxproj index 0be23543d2..1a4f3740b0 100644 --- a/dev/MRTCore/mrt/Core/src/MRM.vcxproj +++ b/dev/MRTCore/mrt/Core/src/MRM.vcxproj @@ -67,7 +67,7 @@ WIN32;_WINDOWS;_USRDLL;UNICODE;_UNICODE;%(PreprocessorDefinitions) true - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include $(OutDir)..\mrmmin\mrmmin.lib;rpcrt4.lib;onecoreuap.lib;%(AdditionalDependencies) diff --git a/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj b/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj index c36111d20e..1f34a069e9 100644 --- a/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj +++ b/dev/MRTCore/mrt/mrm/UnitTests/MrmBaseUnitTests.vcxproj @@ -91,13 +91,13 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) 4309;4838;%(DisableSpecificWarnings) - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include;$(MRTCoreRoot)\mrt\mrm\mrmmin;%(AdditionalIncludeDirectories) 4309;4838;%(DisableSpecificWarnings) diff --git a/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj b/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj index 8c8948b17e..91f861c2f9 100644 --- a/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj +++ b/dev/MRTCore/mrt/mrm/mrmex/mrmex.vcxproj @@ -107,7 +107,7 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include diff --git a/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj b/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj index 624c5bec21..9af96e4e4e 100644 --- a/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj +++ b/dev/MRTCore/mrt/mrm/mrmmin/mrmmin.vcxproj @@ -111,7 +111,7 @@ - $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(MRTCoreRoot)\mrt\mrm\include + $(RepoRoot)\dev\WindowsAppRuntime_Insights;$(MRTCoreRoot)\mrt\mrm\include diff --git a/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj b/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj index f0aaf22aad..5ede563b65 100644 --- a/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj +++ b/dev/PushNotifications/PushNotificationsLongRunningTask/PushNotificationsLongRunningTask.vcxproj @@ -102,7 +102,7 @@ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -112,7 +112,7 @@ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -122,7 +122,7 @@ _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -132,7 +132,7 @@ NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -143,7 +143,7 @@ _DEBUG;_WINDOWS;%(PreprocessorDefinitions) stdcpp20 - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows @@ -154,7 +154,7 @@ NDEBUG;_WINDOWS;%(PreprocessorDefinitions) stdcpp20 - %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(RepoRoot)\dev\common;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL + %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(RepoRoot)\dev\WindowsAppRuntime_Insights;$(OutDir)..\PushNotificationsLongRunningTask.ProxyStub;$(OutDir)\..\WindowsAppRuntime_DLL;$(OutDir)..\WindowsAppSDK_BootstrapDLL Windows From fd5625dcf938015536a63c9b914c3bd0bc085f91 Mon Sep 17 00:00:00 2001 From: agniuks <41223743+agniuks@users.noreply.github.com> Date: Fri, 3 Apr 2026 14:08:03 -0700 Subject: [PATCH 5/5] update release to 1.8.8 Co-authored-by: agniuks <41223743+agniuks@users.noreply.github.com> --- dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h index 78251a0ef7..77a3e5716e 100644 --- a/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h +++ b/dev/WindowsAppRuntime_Insights/WindowsAppRuntimeInsights.h @@ -16,8 +16,8 @@ #include #include -// Bug 61555948: [1.8.6 servicing] AppRuntime_Insights - Add IsPackagedProcess and IsSelfContained to common insights PartB fields -#define WINAPPSDK_CHANGEID_61555948 61555948, WinAppSDK_1_8_7 +// Bug 61555948: [1.8.8 servicing] AppRuntime_Insights - Add IsPackagedProcess and IsSelfContained to common insights PartB fields +#define WINAPPSDK_CHANGEID_61555948 61555948, WinAppSDK_1_8_8 namespace Microsoft::WindowsAppRuntime::Insights { enum class TraceLoggingInformationFlags : std::uint32_t