Fix: Deployment exceptions masked as ERROR_UNHANDLED_EXCEPTION; SetLastFailure logging single chars#6323
Merged
Merged
Conversation
agniuks
requested review from
DrusTheAxe,
lauren-ciha and
ssparach
and removed request for
DrusTheAxe
March 21, 2026 03:11
DrusTheAxe
reviewed
Mar 21, 2026
DrusTheAxe
left a comment
Member
There was a problem hiding this comment.
LGTM modulo one additional change
#include <wil/cppwinrt.h> appears in dev\WindowsAppRuntime_DLL\pch.h but the auto-initializers don't #include that. You should add it to the others like you did DeploymentManagerAutoInitializer.cpp to ensure the right behavior, now and into the future
dir /s/b dev\*autoinitializ*.cpp yields 4 files
- dev\Common\WindowsAppRuntimeAutoInitializer.cpp
- dev\Deployment\DeploymentManagerAutoInitializer.cpp
- dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT-AutoInitializer.cpp
4 dev\WindowsAppRuntime_BootstrapDLL\MddBootstrapAutoInitializer.cpp
You already hit #2. Please do likewise for 1,3,4
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Scottj1s
approved these changes
Mar 23, 2026
This was referenced Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed & why
add wil/cppwinrt.h to DeploymentManagerAutoInitializer.cpp:
97% of DeploymentManager Initialize failures (60,139 of ~62K) report as ERROR_UNHANDLED_EXCEPTION with no actionable signal. Root cause: the activation entry point was missing wil/cppwinrt.h, so WIL's exception translator was never registered and all real errors (E_ACCESSDENIED, package downgrade, etc.) collapsed to a single meaningless code. After this fix those errors will surface with their real HRESULTs, making our initialization failure rate actually debuggable.
Expand catch block in DeploymentManager.cpp
Initialize() only caught winrt::hresult_error, silently bypassing event log, debugger break, and error UI for all other exception types. Replaced with a single catch(...) using wil::ResultFromCaughtException().
Fix dereference bug in SetLastFailure (3 files)
*failure.pszFile dereferences a PCSTR to its first char, confirmed through installer telemetry - we should get the full filename after this change.
Complements #6319 which fixes telemetry activity starting too late to capture early failures.