[release/v7.6.6] Fix FileOnlyEntry crashing on older versions of Windows - #27931
Merged
Patrick Meinecke (SeeminglyScience) merged 1 commit intoSep 1, 2026
Conversation
Patrick Meinecke (SeeminglyScience)
requested a review
from Travis Plunk (TravisEz13)
as a code owner
September 1, 2026 02:10
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Patrick Meinecke (SeeminglyScience)
September 1, 2026 02:10
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Backports the fix from #27880 to release/v7.6.6 to prevent a crash on older Windows versions when querying the WLDP EnableFileOnlyEntry/FileOnlyEntry setting, where the underlying API entry point may not exist.
Changes:
- Wraps the WLDP boolean setting query in a safe helper that catches
DllNotFoundException/EntryPointNotFoundExceptionand treats the setting as disabled. - Adds explicit ETW logging for the “API not available” failure path, instead of allowing an unhandled exception to crash PowerShell.
- Keeps the existing debug override (
__PSLockdownPolicy_<settingName>) behavior for forcing the setting on when the native query returns false.
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Justin Chung (jshigetomi)
approved these changes
Sep 1, 2026
FileOnlyEntry crashing on older versions of WindowsFileOnlyEntry crashing on older versions of Windows
FileOnlyEntry crashing on older versions of WindowsFileOnlyEntry crashing on older versions of Windows
Patrick Meinecke (SeeminglyScience)
merged commit Sep 1, 2026
2de3d96
into
PowerShell:release/v7.6.6
38 checks passed
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.
Backport of #27880 to release/v7.6.6
Triggered by Patrick Meinecke (@SeeminglyScience) on behalf of Patrick Meinecke (@SeeminglyScience)
Original CL Label: CL-Engine
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Customer Impact
Fixes a crash when the new EnableFileOnlyEntry WLDP setting check runs on older Windows versions that lack the corresponding API; EntryPointNotFoundException is now caught and treated as a false result instead of crashing.
Regression
REQUIRED: Check exactly one box.
Introduced by #26752 (backported as #27922), which added the FileOnlyEntry WLDP setting check without accounting for older Windows versions missing the API.
Testing
Cherry-picked cleanly with no conflicts, now that the prerequisite PR #26752 (backport #27922) is present in the release branch.
Risk
REQUIRED: Check exactly one box.
Fixes a crash on older Windows versions caused by the FileOnlyEntry WLDP check backported in #27922; catches EntryPointNotFoundException and treats it as a false result. Fix is narrowly scoped to the new opt-in setting's code path.