rdl writer: propagate SupportedArchitecture to un-nested inner types - #4058
Merged
Kenny Kerr (kennykerr) merged 2 commits intoMar 20, 2026
Merged
Conversation
…ested types Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/51c76800-d8c7-4998-8e13-7749a5e2944f
Co-authored-by: kennykerr <9845234+kennykerr@users.noreply.github.com> Agent-Logs-Url: https://github.com/microsoft/windows-rs/sessions/51c76800-d8c7-4998-8e13-7749a5e2944f
Copilot created this pull request from a session on behalf of
Kenny Kerr (kennykerr)
March 20, 2026 19:11
View session
Kenny Kerr (kennykerr)
marked this pull request as ready for review
March 20, 2026 19:27
Kenny Kerr (kennykerr)
deleted the
copilot/add-architecture-attributes-propagation
branch
March 20, 2026 20:07
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.
When the RDL writer un-nests anonymous inner types from arch-restricted structs/unions, the synthesised helper types (e.g.
SLIST_HEADER_0) were emitted without anySupportedArchitectureattribute, incorrectly making them appear available on all architectures.Changes
collect_nested— addsparent_arches: i32parameter; computeseffective_arches = parent_arches | nested.arches()per inner type so unrestricted inner types inherit the parent's constraint. Propagated recursively for deeply-nested cases. Now also emits any other custom attributes on inner types (previously none were written).write_arch_attr— new helper mapping the arch bitmask (bit 0 = X86, bit 1 = X64, bit 2 = Arm64) to#[Windows::Win32::Foundation::Metadata::SupportedArchitecture(...)]tokens; returns empty stream for zero or unrecognised bits.write_struct_items— seedscollect_nestedwithitem.arches()from the outermost type.tests/nested-arches— regression test filteringWindows.Win32.System.Kernel; the committednested-arches-out.rdlshowsSLIST_HEADER_0/SLIST_HEADER_1each carrying the correct per-arch attribute.