Handle empty package enumeration during COM manual activation - #6496
Open
Ratin Gao (RatinCN) wants to merge 1 commit into
Open
Handle empty package enumeration during COM manual activation#6496Ratin Gao (RatinCN) wants to merge 1 commit into
Ratin Gao (RatinCN) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Ratin Gao (RatinCN)
marked this pull request as ready for review
August 31, 2026 16:09
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Member
|
This code is not relevant for SYSTEM use, but the change appears righteous for standard users. |
Author
Agreed. SYSTEM is not supported for this OutOfProc path and was only used to reproduce the issue. This change handles the valid empty result by returning |
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.
📖 Description
The initial sizing call to
FindPackagesByPackageFamilyreturnsERROR_INSUFFICIENT_BUFFERwhen matching packages exist, but can validly returnERROR_SUCCESSwith a count of zero when no package is registered for the current identity.The current code passes that success result to a failure-only WIL macro, causing the calling process to CRASH through FAIL_FAST instead of receiving a normal HRESULT. This change accepts the valid empty result and lets the existing control flow return
ERROR_PACKAGE_NOT_REGISTERED_FOR_USERinstead.The registered-package path and propagation of other Win32 errors remain unchanged. This is consistent with the handling established in #2922.
For the SYSTEM scenario in #4944, this prevents the direct CRASH caused by FAIL_FAST, but does not add OutOfProc COM support, enumerate packages registered to other users, or use staged packages.
🔗 References
FindPackagesByPackageFamilydocumentation🔍 Validation
0xC0000409(FAIL_FAST).ERROR_SUCCESSwith a package count of zero under SYSTEM.Microsoft.Management.Deployment.OutOfProcfor x64 Debug with the production package family and CLSIDs.COMExceptionwith HRESULT0x80073D35; exit code 0 with no process crash.✅ Checklist
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow