Repository navigation
fix: Windows Features names the features Windows turns on with the one you enable, and shows them on afterwards - #2944
Merged
laurentiu021 merged 1 commit intoOct 21, 2026
Conversation
…e you enable, and shows them on afterwards - New IFeatureParentsService / FeatureParentsService reads, through the DISM API's DismGetFeatureParent, every feature another one needs: its parents, theirs and so on. dismapi.dll is loaded from System32 only. - Before a change the view model asks it, and the confirmation names what turning the feature on turns on with it, or the features it needs, which stay on when it is turned off. After turning one on, those rows are written from DISM's answer and the status line says how many came on. Enabling passes -All, and only the clicked feature was named.
laurentiu021
deleted the
fix/windows-features-names-the-parents-it-turns-on
branch
October 21, 2026 23:05
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.
Closes #2834 with part 1, the last of its parts that changes what the tab does. Part 5 is now #2943.
Confirmed in the code: Enable runs
Enable-WindowsOptionalFeature … -All, which turns on every parent the named feature needs, and the confirmation named only the clicked feature. After the change only that row was written, so the parents that came on read Disabled until the next scan.The PowerShell cmdlets do not report parents, and the DISM API does. What I checked on my PC, read-only and as administrator:
DismGetFeatureParentgivesIIS-ASPNET45six direct parents, among themNetFx4Extended-ASPNET45, givesIIS-WebServerIIS-WebServerRole, givesTelnetClientnone, and refuses a name Windows does not know with 0x800F080C. ItsDismFeatureis packed to one byte, a name pointer and then the state, which is what the six read back correctly showed.The changes:
IFeatureParentsService/FeatureParentsService: one DISM session per question, one at a time, walkingDismGetFeatureParentthrough every parent, nearest first and each once, with a limit of 64 against a list that never ends. Each parent carries whether it is on and whether a change to it waits for a restart. Null when DISM cannot be asked, so the tab never claims to know.dismapi.dllis not one of the DLLs Windows always loads from System32, and SysManager runs elevated, so every import carriesDefaultDllImportSearchPaths(System32).WindowsFeaturesViewModelasks it before the confirmation, with the bar moving and "Checking what X needs…" on the status line, which goes back afterwards. Enabling says "Windows turns these on with it, because it needs them: …", ten names and then a count; disabling says "The features it needs stay on: …"; and when DISM could not be asked, enabling says "Windows also turns on any other features it needs.".ServiceRegistrationand passed in the designer graph.I left two things out on purpose. The issue suggested trying the change without
-Allfirst, but asking DISM first names the parents without a failed servicing run. And offering to turn the parents off when the feature is turned off would need to know which other features still need them; the confirmation names them instead, and each row can turn its own off.Part 5 of #2834 (the admin banner's place below the toolbar, and Shortcut Cleaner's banner margin) moves where things sit on screen, so it waits for a look at a mockup, and is now #2943.
Docs
README, Windows Features: what else comes on. ARCHITECTURE: the new service, the seam count and list, and
WindowsFeaturesViewModel.Tests
FeatureParentsServiceTests(unit): the walk lists every feature needed, nearest first and each once; goes on through a parent that is on; reads each DISM state; knows nothing when DISM does not answer; ends on a loop and never lists the feature itself; stops at its limit; skips a blank name; and every DISM call loads dismapi.dll from System32 only.WindowsFeaturesTests: enabling names what comes on and shows those rows on afterwards, with the count on the status line and a restart one setting the notice; disabling names what stays on; DISM not answering gives the general sentence and the status line goes back; ten names and then a count.FeatureParentsServiceTests(integration), as administrator: the real DISM API reads whatIIS-ASPNET45needs,IIS-WebServerRoleandNetFx4Extended-ASPNET45among them, and knows nothing of a name Windows does not know.EveryStringMarshallingInterop_BindsTheWideEntryPointlists the three DISM functions that take text as Unicode-only, with the call that confirms it.WindowsFeaturesTests,FeatureParentsServiceTests,SafetyDatabaseTests,ArchitectureTests,AcceleratorRoutingTests,SystemPathsTests,InclusiveTermsTests,ServiceRegistrationGraphTests,FileLockServiceTestsandPerformanceServiceExtendedTests, and the integrationFeatureParentsServiceTests,WindowsFeatureScriptTests,AllViewModelsSweepTestsandMainWindowViewModelTests. All four projects build with 0 warnings, anddotnet format --verify-no-changesis clean.